Is there a way to iterate over seaborn/matplotlib graph settings (or trade default)?

i’m looking for a manner to change the parameters of graphs (now not the aesthetics of it). i’ve seemed and the whole lot pops with aesthetics handiest. what i imply is, for example, seaborn i need to change all my graphs to use:

inner=‘quartile’

however i’ve a variety of graphs and that i honestly do not want to exchange them one at a time (although i did loop a couple) and different parameters i’d want to deal with later. but i wish to set perhaps a placing like seabon.set form of command or feature. is that viable?

I’m not familiar with seaborn but in matplotlib you can alter figures, axes and plots by maintaing a reference to them and simply calling the relevant methods. I assume since seaborn is built on top of matplotlib that something very similar is viable. Altering the plot itself would need a reference to that plot object.

For multiple plots you’d need references to each of them so lopping through a list or tuple would be easiest. If you can’t change the original code to do this then you could for example hunt down the objects you need and subsequently add references to them with commands like ax.get_children() but it would probably be more work.

I’m afraid I can’t offer more info on seaborn itself. Is there no way to do this when creating the plot, e.g. with a keyword argument? Have you tried checking the documentation or a web search?

Various methods of altering figure, axes and plot after creation.

fig, ax = plt.subplots()
fig.show()
ax.set_title('test123')
plot1_data, = ax.plot([1, 2, 3])  # method supplies a list of objects
plot1_data.set_xdata([-1, -2, -3])
ax.set_xlim([-3, -1])
fig.tight_layout()
fig.show()
1 Like

You can change the settings when you create a graph. Or you can loop over your plots and change settings, I suppose. If you know you want to make all of your plots with certain settings, I recommend making a class for that type of plot and then each one can be an instance of that class.

2 Likes

i’m looking for a manner to change the parameters of graphs (now not the aesthetics of it). i’ve seemed and the whole lot pops with aesthetics handiest. what i imply is, for example, seaborn i need to change all my graphs to use: https://19216811.cam/

inner=‘quartile’ https://1921681001.id/

however i’ve a variety of graphs and that i honestly do not want to exchange them one at a time (although i did loop a couple) and different parameters i’d want to deal with later. but i wish to set perhaps a placing like seabon.set form of command or feature. is that viable?

my issue got solved!!!