Reputation: 2993
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(10))
ax.plot(2 * range(10))
I have a function (basic_axis(ax)) that will set spines linewidth (ax.spines.set_linewidth()), tick length (ax.tick_paras(...), ... but I don't find how to also set all plots linewidth with one value. Is it possible to do it through a function that takes only ax as parameter?
Upvotes: 3
Views: 2372
Reputation: 87556
All of the line-like artists are added to Axes.lines
so you should be able do to this with
def bulk_lw_adjuster(ax, lw=5):
for ln in ax.lines:
ln.set_linewidth(lw)
Upvotes: 3