Aman Rathore
Aman Rathore

Reputation: 1

How to change Border width in MatPlotLib?

I know how to make border visible/non-visible and color-full (Graph With Customized borders)

but I don't know how to change width of borders can someone help me out in this

Upvotes: 0

Views: 8401

Answers (1)

Akroma
Akroma

Reputation: 1290

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)

for axis in ['top', 'bottom', 'left', 'right']:

ax.spines[axis].set_linewidth(2.5)  # change width
ax.spines[axis].set_color('red')    # change color

plt.show()

thin red

thick blue

Upvotes: 4

Related Questions