Giter Club home page Giter Club logo

Comments (6)

MikeAMCloud avatar MikeAMCloud commented on May 21, 2024 1

Yes the above code does work.

An example with tkinter follows:

DrawPlot.docx

from mplfinance.

DanielGoldfarb avatar DanielGoldfarb commented on May 21, 2024 1

wip

from mplfinance.

DanielGoldfarb avatar DanielGoldfarb commented on May 21, 2024

Your code above looks fine; I think you can simplify the else block as:

else:
    if config['returnfig']:
        return (fig)            
    # https://stackoverflow.com/a/13361748/1639359 suggests plt.show(block=False)
    plt.show(block=config['block'])

(the validator is already ensuring that config['returnfig'] is a bool, so there is no worry it's None).

I have never used tkinter so I don't know enough to say if returning the Figure will accomplish what you want it to. I suggest, if you feel comfortable, you can make the above change in your own fork, and then test it with your tkiniter code and let me know how it works out. If it accomplishes what you want it to accomplish with tkiniter, then I will consider merging it in.

from mplfinance.

DanielGoldfarb avatar DanielGoldfarb commented on May 21, 2024

OK. There are enough people asking for this. I will include it in the next release. (Maybe a week; maybe two weeks). Thanks for getting back to me.

from mplfinance.

MikeAMCloud avatar MikeAMCloud commented on May 21, 2024

Thanks for the quick responses.

Although I have not tried this, it seems that if one desired to add additional subplots, one could return the figure from mplfinance and then add as many subplots as one wanted using figure.add_subplot

from mplfinance.

DanielGoldfarb avatar DanielGoldfarb commented on May 21, 2024

Thanks for the quick responses.

Although I have not tried this, it seems that if one desired to add additional subplots, one could return the figure from mplfinance and then add as many subplots as one wanted using figure.add_subplot

I don't think that will work, because by default the subplots that mpf.plot() creates (main panel and lower [volume] panel) take up the entire Figure (except to leave some room for the axis labels).

However, I am now 95% certain that I will implement something like what I outlined here which should allow users to create as many subplots as desire in whatever configuration they desire. (The only uncertainty is not knowing what, if any, issues I may encounter while testing it; but my preliminary experiments seem to indicate that it will work OK).

from mplfinance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.