-
Notifications
You must be signed in to change notification settings - Fork 653
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
Feature Request: HLines on AddPlot #204
Labels
enhancement
New feature or request
Comments
duplicate of #140 |
Hi @luongjames8, In the mean time, you can easily add hlines to addplots like so: # Suppose you have DataFrame Column with 'LOGRET'
cumlog_return = df['LOGRET'].cumsum() # cumulative log return
hline0 = [0] * df.shape[0] # You need a hline=0
ap0 = [
mpf.make_addplot(cumlog_return, color='black', panel=2)
mpf.make_addplot(hline0, color='gray', panel=2)
]
mpf.plot(
df, type="candle", volume=True, addplot=ap0,
figscale=1.8, panel_ratios=(7, 2, 2), style='classic',
title=f"\n{ticker}",
) Hope this helps! |
Thanks KJ - will give this a try! |
And what about adding vlines on panels? Is there some workaround? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is it possible to implement hlines (and vlines) for addplots. Right now they’re only available on the primary panel.
The vlines functionality might require a bit more thought as it seems more intuitive that the vlines would slice through all the charts vertically. But I suppose an easy work around would just be the draw the same vertical line on the main plot and addplot for now.
The text was updated successfully, but these errors were encountered: