0

I would like to change the color or the width of the axes of a plot.

For example, from this: First image

I would like to get: Final image

Is it possible?

Thanks

tmdavison
  • 64,360
  • 12
  • 187
  • 165
AJ528
  • 23
  • 2
  • 7

1 Answers1

2

You can use the spines attribute of your axis:

f, ax = plt.subplots(1)

for side in ax.spines.keys():  # 'top', 'bottom', 'left', 'right'
    ax.spines[side].set_linewidth(5)

plt.plot(numpy.arange(10))
plt.show()
Nils Werner
  • 34,832
  • 7
  • 76
  • 98