Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

How to push my marker subplot in front of the main plot wick? (problem with candles and wicks) #357

Open
Omri93h opened this issue Mar 18, 2021 · 2 comments
Labels
question Further information is requested

Comments

@Omri93h
Copy link

Omri93h commented Mar 18, 2021

Hello.
when im adding a mark(I've used 'v') with mpf.make_addplot ,
my subplot is at a better visual priority from the candles, but not the wicks.
image

is that a bug? is there anything im doing wrong?
I've used "inherit" in styling, and my make_addplot is pretty simple.

image
image

@Omri93h Omri93h added the question Further information is requested label Mar 18, 2021
@DanielGoldfarb
Copy link
Collaborator

You are not doing anything wrong. This has to do with zorder as you noted over here.

Until zorder is implemented, you can try two things:

  1. Plot your markers further away from the candles so that they don't overlap with the candles:
    Click here for example code for doing this.

  2. Pass alpha=0.5 in to your make_addplot() call so that the markers are somewhat transparent.

Please also see my comment here if you have not already seen it.

@Dror77
Copy link

Dror77 commented Jul 10, 2021

In the meanwhile I can suggest a small hack.. In plotting.py file which is in the installation folder of mplfinance add zorder in the relevant line of code (I also added edgecolor as shown in the code below):

if aptype == 'scatter':
size = apdict['markersize']
mark = apdict['marker']
color = apdict['color']
alpha = apdict['alpha']

    if isinstance(mark,(list,tuple,np.ndarray)):
        _mscatter(xdates,ydata,ax=ax,m=mark,s=size,color=color,alpha=alpha)
    else:
        ax.scatter(xdates,ydata,s=size,marker=mark,color=color,alpha=alpha,zorder=3,edgecolor='white')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants