Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matplotlib bar plot remove internal lines

I have a bar plot with high resolution. Is it possible to have only the border/frame/top line of the plot like in the following ROOT plot without, i.e. without internal lines?

ROOT plot, empty inside

If I plot with facecolor='none' or 'white', the plot is slashed by both vertical and horizontal lines:

bar plot color none

The only way I can get rid of them is to make edgecolor and facecolor the same, but that's not the look I need...

like image 995
sagitta Avatar asked Mar 03 '16 09:03

sagitta


People also ask

How do I get rid of Xticks in Matplotlib?

To remove the ticks on the x-axis, tick_params() method accepts an attribute named bottom, and we can set its value to False and pass it as a parameter inside the tick_params() function. It removes the tick on the x-axis.

How do I get rid of gridlines in Python?

MatPlotLib with Python Convert the image from one color space to another. To remove grid lines, use ax. grid(False).


1 Answers

Found out the answer: the simplest way to achieve the desired look is to use plt.step instead of plt.bar, that simple. Feel shame for asking.

step plot

like image 109
sagitta Avatar answered Oct 09 '22 00:10

sagitta