Skip to content

zorder of plots (scatter - line) added with addplot #311

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
JessicaG11 opened this issue Jan 8, 2021 · 4 comments
Open

zorder of plots (scatter - line) added with addplot #311

JessicaG11 opened this issue Jan 8, 2021 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@JessicaG11
Copy link

Is there a way to manage the order (z axis) of the graphs added with addplot? Currently I would like to display my scatter on top of my line, but no matter what order I pass them in addplot the line appears on top. With matplotlib there is zorder which manages this.

Here is a small exemple of code for which the line_plot appears over the scatter_plot:
scatter_plot = mpf.make_addplot(scatter_data, type='scatter')
line_plot = mpf.make_addplot(line_data, type='line')
mpf.plot(candle_data, type='candle', addplot=[scatter_plot, line_plot])

Thank you very much!

@JessicaG11 JessicaG11 added the question Further information is requested label Jan 8, 2021
@DanielGoldfarb
Copy link
Collaborator

Jessica,

Good point! I think we should add a zorder kwarg to both mpf.plot() (for the candles, etc.) and mpf.make_addplot().
Candles may be tricky because they are made up of both line collections and patch colletions which by default have different zorders; however adding zorder to make_addplot() should be relatively trivial. Are you interested in making the change?

Thanks. --Daniel

@DanielGoldfarb
Copy link
Collaborator

I did a little playing around with the code. Even the candlesticks will be easy to set the zorder.

@DanielGoldfarb DanielGoldfarb added the enhancement New feature or request label Jan 10, 2021
@Omri93h
Copy link

Omri93h commented Mar 18, 2021

Hi, is there any solution for that?
i have the same problem,
can REALLY use zOrder in my subplots

@DanielGoldfarb
Copy link
Collaborator

@Omri93h
Omri,
I am hoping to have time to implement a zorder kwarg for plot() and for make_addplot() sometime in the next 6 to 8 weeks. If you would like to contribute this enhancement to mplfinance, I would be happy to guide you through the process; just let me know.
All the best. --Daniel

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants