matplotlib / matplotlib/mplfinance
Feature Request: New style called binance-dark
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 4.4k
- Fork
- 678
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I would like to suggest the addition of a new style for the mplfinance library. The addition of this feature will improve the plot styles since there isn't a good dark style plot yet and will provide a better user experience.
I have copied the binance dark theme color scheme and code it, so I would like to propose a new style called binance_dark or somethink similar in addition to the binance style. Nevetheless, the style could be definitely be improved even more yet I would like to make the first step.
Additional context
Here is an example code snippet that demonstrates how this feature can be implemented:
binance_dark = {
"base_mpl_style": "dark_background",
"marketcolors": {
"candle": {"up": "#3dc985", "down": "#ef4f60"},
"edge": {"up": "#3dc985", "down": "#ef4f60"},
"wick": {"up": "#3dc985", "down": "#ef4f60"},
"ohlc": {"up": "green", "down": "red"},
"volume": {"up": "#247252", "down": "#82333f"},
"vcedge": {"up": "green", "down": "red"},
"vcdopcod": False,
"alpha": 1,
},
"mavcolors": ("#ad7739", "#a63ab2", "#62b8ba"),
"facecolor": "#1b1f24",
"gridcolor": "#2c2e31",
"gridstyle": "--",
"y_on_right": True,
"rc": {
"axes.grid": True,
"axes.grid.axis": "y",
"axes.edgecolor": "#474d56",
"axes.titlecolor": "red",
"figure.facecolor": "#161a1e",
"figure.titlesize": "x-large",
"figure.titleweight": "semibold",
},
"base_mpf_style": "binance-dark",
}
can = pd.read_csv("data1.csv", parse_dates=True, index_col=0)
# Plot the candlestick chart
mpf.plot(
can,
type="candle",
style=binance_dark,
title="BTCUSDT",
ylabel="Price ($)",
ylabel_lower="Volume",
volume=True,
mav=(2, 4, 6),
update_width_config=dict(candle_linewidth=0.5, candle_width=0.5),
)
Here is a preview of how the style of the plot looks like

Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
La issue fornisce un dizionario di stile binance_dark proposto e un esempio di utilizzo di mpf.plot, ma non indica alcun file sorgente né alcun test. Inizia individuando come mplfinance definisce ed espone gli stili esistenti, come binance, quindi confronta un grafico renderizzato con l’anteprima allegata. Il lavoro è completato quando il nuovo stile è disponibile tramite la libreria e produce il grafico a candele scuro richiesto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- matplotlib, python
- Ambito
- data-visualization
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100