matplotlib / matplotlib/mplfinance

Feature Request:addplot does not take dataframe index

Aperta
#323 10 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Python
Stelle
4.4k
Fork
678
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I would like to plot two data as below.

```
plot2 = mpf.make_addplot(data2, type='candle')
mpf.plot(data, type='candle', addplot=plot2)
```

However, the problem is that data2 contains 3 candles and data contains 4 candles with different indices.

data2.index
`['2021-01-05', '2021-01-06', '2021-01-07']`

data.index
`['2021-01-04', '2021-01-05', '2021-01-06', '2021-01-07']`

Despite the fact that the time index of data2 starts from 2021-01-05, the plot starts from 2021-01-04
You can see three overlapped candles on 01-04, 01-05, 01-06.
![Selection_007](https://user-images.githubusercontent.com/34349131/105678422-7b803200-5f30-11eb-8e16-3b1d0553c1ef.png)

Please allow addplot to have its own x values as the index of the input dataframe.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start by reproducing the reported example with mpf.make_addplot() and mpf.plot(), using the two dataframes and their differing indices. Inspect how addplot data is positioned relative to the main plot's x values. Done means addplot uses its input dataframe index so the three candles align with 2021-01-05 through 2021-01-07 rather than starting at 2021-01-04.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
matplotlib, python
Ambito
data-visualization
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.