You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
az.plot_trace(trace) hangs unless var_names is specified
Output:
az.plot_trace(trace)
/Users/kpmurphy/anaconda3/lib/python3.7/site-packages/arviz/plots/traceplot.py:218: UserWarning: rcParams['plot.max_subplots'] (40) is smaller than the number of variables to plot (102), generating only 40 plots
UserWarning,
Out[7]:
array([[<matplotlib.axes._subplots.AxesSubplot object at 0x1a31f5b510>,
<matplotlib.axes._subplots.AxesSubplot object at 0x1a31fa46d0>],
...
To Reproduce
import pymc3 as pm
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
import arviz as az
np.random.seed(1)
N = 100
alpha_real = 2.5
beta_real = 0.9
noiseSD = 0.5
eps_real = np.random.normal(0, noiseSD, size=N)
x = np.random.normal(10, 1, N) # centered on 10
y_real = alpha_real + beta_real * x
y = y_real + eps_real
with pm.Model() as model:
w0 = pm.Normal('w0', mu=0, sd=10)
w1 = pm.Normal('w1', mu=0, sd=1)
mu = pm.Deterministic('mu', w0 + w1 * x)
y_pred = pm.Normal('y_pred', mu=mu, sd=noiseSD, observed=y)
trace = pm.sample(1000)
az.plot_trace(trace, var_names=['w0', 'w1']) # works
az.plot_trace(trace) # hangs
Expected behavior
Should plot trace of w0 and w1
Additional context
az.version '0.7.0'
pm.version '3.8'
The text was updated successfully, but these errors were encountered:
Hey Kevin --
The default changed to draw different variable dimensions in their own axes, so mu is a 100 dimensional variable, and the kernel likely freezes trying to create a large enough plot.
The next release (coming soon!) will bravely fail and give a useful warning about this. To get the previous behavior, use compact=True:
There was a bug in enforcing the rcParam plot.max_subplots, instead of generating 40 plots at max, it allowed up to 80 plots, which is generally too high to prevent freezing (which is the reason to be of this rcParam). This has been fixed in #1205 so I'll close the issue.
If the issue persists, an arvizrc file can be used to modify the default for plot.max_subplots to a more restrictive value
Describe the bug
A clear and concise description of what the bug is.
az.plot_trace(trace) hangs unless var_names is specified
Output:
To Reproduce
Expected behavior
Should plot trace of w0 and w1
Additional context
az.version '0.7.0'
pm.version '3.8'
The text was updated successfully, but these errors were encountered: