I'm using pyplot.bar but I'm plotting so many points that the color of the bars is always black. This is because the borders of the bars are black and there are so many of them that they are all squished together so that all you see is the borders (black). Is there a way to remove the bar borders so that I can see the intended color?
Asked
Active
Viewed 8.1k times
77
-
6Read the docstring for `bar`. It says right there that setting `linewidth=0` means don't draw edges. – Warren Weckesser Apr 09 '13 at 14:58
2 Answers
139
Set the edgecolor
to "none"
: bar(..., edgecolor = "none")

Robbert
- 2,684
- 1
- 15
- 12
-
Whereas plural `edgecolors` works for scatterplots, only singular `edgecolor` works for bar graphs. – interpolack Jul 28 '15 at 19:43
-
Both `linewidth=0` and `edgecolor='none'` works also in `stackplot` :-) – Antonello Aug 19 '16 at 06:42
-
1
20
Another option is to set edgecolor
to be the intended color in your call to bar
:
# If your intended color is blue, this will work:
bar(. . . , edgecolor='b')

abcd
- 10,215
- 15
- 51
- 85