0
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?

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61
David
  • 13
  • 5

1 Answers1

0

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!

Daniel Goldfarb
  • 6,937
  • 5
  • 29
  • 61
  • I need both plots. The vwap is the blue line with the OLHC candles on top and the volume is the bar below. I need both of them. – David Apr 05 '23 at 01:41
  • So, do you want to get rid of the red/green volumes, and keep the grey volumes? Or you want both volume plots but just not on top of each other? *They are the same data.* I don't understand why you would want both volume plots. Pick the one you want. The red/green one comes from the `volume=True` kwarg. – Daniel Goldfarb Apr 05 '23 at 09:47
  • No, I would like to get rid of the grey volume bars and get rid of the grey one – David Apr 06 '23 at 15:08
  • So, you have your answer: - Remove the `mpf.make_addplot(df['volume']...` - (but keep `mpf.make_addplot(df['VWAP'],`) – Daniel Goldfarb Apr 09 '23 at 02:03