I am creating some functions to create quality figures of a standard form using matplotlib. I typically create line plots, contour plots, etc. Is there a way to pass parameters (axis limits, tick locations, etc.) to matplotlib that instructs matplotlib to use the default values of the parameters? For example
I create a class
class my_class(object):
xlimit = *something matplotlib reads as "use default"*
ylimit = *something matplotlib reads as "use default"*
linwidth = *something matplotlib reads as "use default"*
I create an instance of this class, but I only want to specify the xlimit
inst = myclass()
inst.xlimit = [0,1]
And I leave the ylimit unchanged, so matplotlib treats it as default.
I then have a function
def plot_func(x,y,fig,inst):
ax = fig.gca()
ax.set_xlim(inst.xlimit)
ax.set_ylim(inst.ylimit)
ax.plot(x,y,linewidth=inst.linwidth)
return fig
Which I can call and pass my class instance. So far this is working for me just fine, but I have to set values for all my plotting parameters in my_class().
Is there a way to set these values in my_class() to something, so that if I decide I just want matplotlib's default calculations for things like limits, ticks, labels, etc. I can still pass these 'variables' to my function plot_func() where they will all be set and I can customize what I want, and leave everything else as default?
Just to avoid these answers, I am aware of matplotlib's rc settings, this is not what I am looking for.

