I've made a python script to convert a csv file in a candlestick like this using mpl_finance, this is the script:
import matplotlib.pyplot as plt
from mpl_finance import candlestick_ohlc
import pandas as pd
import matplotlib.dates as mpl_dates
plt.style.use('ggplot')
# Extracting Data for plotting
data = pd.read_csv('CSV.csv')
ohlc = data.loc[:, ['Date', 'Open', 'High', 'Low', 'Close']]
ohlc['Date'] = pd.to_datetime(ohlc['Date'])
ohlc['Date'] = ohlc['Date'].apply(mpl_dates.date2num)
ohlc = ohlc.astype(float)
# Creating Subplots
fig, ax = plt.subplots()
plt.axis('off')
fig.patch.set_facecolor('black')
candlestick_ohlc(ax, ohlc.values, width=0.6, colorup='green', colordown='red', alpha=0.8)
plt.show()
Now I need to do the same thing but using mplfinance instead of mpl_finance and I've tried like this:
import mplfinance as mpf
# Load data file.
df = pd.read_csv('CSV.csv', index_col=0, parse_dates=True)
# Plot candlestick.
# Add volume.
# Add moving averages: 3,6,9.
# Save graph to *.png.
mpf.plot(df, type='candle', style='charles',
title='',
ylabel='',
ylabel_lower='',
volume=True,
mav=(3,6,9),
savefig='test-mplfiance.png')
And I have this result:
So, now I need to change background color from white to black, remove grid and remove axes but I have no idea how to do it.
Thanks to all will spend time for reply me.
[EDIT]: this is an old question I've ade when mpl_finance was at It's first stage, now a lot of things are changed and this question is obsolete.