Remove the stack bars

133 views Asked by At
ap = [ mpf.make_addplot(df['VWAP'], color='blue', width=0.8,
                        panel=0, ylabel='VWAP ($)'),
       mpf.make_addplot(df['volume'], type='bar', color='dimgray',
                        width=0.8, panel=1, ylabel='Volume',
                        secondary_y=False)]

mpf.plot(df, type='candle', style="yahoo", volume=True,
         addplot=ap, title=args.ticker, 
         ylabel='Price ($)', ylabel_lower='Shares\nTraded')

enter image description here

As you can see on the plot, there is two stack volume bars, i.e. a red or green bar and a grey bar over it. How can I remove the grey bar?

1

There are 1 answers

4
Daniel Goldfarb On

You are putting the grey bars there yourself with

mpf.make_addplot(df['volume'], type='bar', color='dimgray',
                        width=0.8, panel=1, ylabel='Volume',
                        secondary_y=False)]

Just remove that make_addplot call, and you will remove the grey bar!