matplotlib / matplotlib/mplfinance

zorder of plots (scatter - line) added with addplot

Open
#311 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
Python
Stars
4.4k
Forks
678
PR merge metrics
No merged PRs in 30d

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided candle, scatter, and line example with mpf.make_addplot() and mpf.plot(). Trace how addplot entries are rendered and how their order is determined. Done means callers can control whether the scatter is drawn above the line, with the existing example behaving as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
matplotlib, python
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.