Say I have a matplotlib axes called ax
, and I want to set several of its properties. Currently, I do it like this:
ax.set_yscale('log')
ax.set_xlim([0,10])
ax.set_xlabel('some label')
But it gets tedious after a while. Then I ran into this method:
ax.set(yscale='log', xlim=[0,10], xlabel='some label')
Much more concise, but it seems a bit undocumented. I mean all the documentation says is "A tkstyle set command, pass kwargs to set properties".
What is the preferred or idiomatic way?
Is the set
method api stable?