Arviz limit number of plots

Hi All,

I apologise for a basic question.

I have noticed that az.plot_posterior() allows to visualise a limit of up to 40 plots even if I specified the range().

Could someone confirm and suggest how to specify it so that to be able to visualise all the results?

Thank you very much in advance

1 Like

I believe you can use plt.rcParams.max_subplots to configure the maximum number of subplots allowed, based on this pull request to ArviZ.

This comes with the following disclaimers:

  • I’m not an ArviZ developer
  • I haven’t tried this out myself
  • Know that making lots of plots at once can cause your interpreter to hang (that’s why there’s a limit)

But I hope it helps you :slight_smile:

There is indeed an rcParam that limits the maximum number of subplots per figure. It is set as an rcParam instead of a function argument in order to allow 1) having a shared default for all functions at the same time and 2) allowing to easily set the default depending on the computer capabilities.

ArviZ implements its own rcParams, based on matplotlib ones in order to make their usage familiar to matplotlib users, but they are not interchangeable. It can be modified with az.rcParams["plot.max_subplots"] = 200 or also with az.rc_context. Some plots also have a max_subplots argument.

I wrote a blogpost about ArviZ rcParams which could also be helpful.


Thank you so much to both of you for being so prompt and for the explanations :blush: