matplotlib / matplotlib/mplfinance
Have a problem, when I work with external_axes.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 4.4k
- Forks
- 678
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hi, I need to add to the plot some text and I tried to use your guide "How to use your own matplotlib Figure and Axes in mplfinance". But i have an error:
"ValueError: make_addplot() `ax` kwargs must all be of type `matplotlib.axis.Axes`"
My code:
```
import mplfinance as fplt
import pandas as pd
df5M = pd.read_csv("D:\\_users_files\\Kirill\\WORK\\fx2youcom\\df5M.csv", index_col=0, parse_dates=True)
fig = fplt.figure(style='yahoo', figsize=(10.8, 6.4))
ax1 = fig.add_subplot(2, 2, 1)
sma = [fplt.make_addplot(df5M['SMA20'].tail(100), color='#f1afe1'),
fplt.make_addplot(df5M['SMA50'].tail(100), color='#ffaf6c'),
fplt.make_addplot(df5M['SMA200'].tail(100), color='#f0dea7')]
fplt.plot(df5M.tail(100),
type='candle',
ax=ax1,
style='yahoo',
title="long_name",
ylabel='5 Minutes',
addplot=sma
)
fig
```
Thank you for help, you do really helpful framework!
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginnen Sie mit dem Leitfaden „So verwenden Sie Ihre eigene matplotlib Figure und Axes in mplfinance“ und reproduzieren Sie das Beispiel mit make_addplot(), wobei die externe ax1 an fplt.plot() übergeben wird. Verfolgen Sie die Validierung, die den Fehler matplotlib.axis.Axes auslöst, und überprüfen Sie anschließend, dass die bereitgestellte Figure und Axes mit den SMA-Addplots und dem Candle-Plot wie gezeigt funktionieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- matplotlib, pandas, python
- Bereich
- data-visualization
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100