9

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...

sagitta
  • 321
  • 2
  • 7
  • 1
    Look for example at http://stackoverflow.com/questions/11297030/matplotlib-stepped-histogram-with-already-binned-data. There are several similar questions already answered on SO – MrCyclophil Mar 03 '16 at 09:58
  • @MyCyclophil Thanks for the answer! I actually finally found it out, the problem was that I was using `plt.bar` instead of `plt.step` thinking that the latter one would be a subtype of the former one. And I was always searching "plot binned data", "histogram remove internal lines", "bar plot only contour" etc. My apologies for making a question solved elsewhere, my solution now is simply `plt.step(xvalues, yvalues)` – sagitta Mar 04 '16 at 11:18
  • No problem. Sometimes it is hard to find the right key words even though you know exactly what you are looking for. – MrCyclophil Mar 04 '16 at 13:16

2 Answers2

13

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

Mike Müller
  • 82,630
  • 20
  • 166
  • 161
sagitta
  • 321
  • 2
  • 7
0

As referenced here, you can set histtype='step' to remove internal lines. For example,

plt.hist(data, histtype='step')
Shep Bryan
  • 567
  • 5
  • 13