Is there something extra I need to do to show my PyMC3 plots.traceplot
results in PyCharm? I just discovered that I need a print()
statement around pm.summary()
. so I'm wondering if there is another function for the plots. Thank You!

- 7,315
- 4
- 29
- 40

- 3
- 2
1 Answers
PyMC3 uses ArviZ for plotting (as well as for statistics and summary such as summary
) which at the same time, relies on either matplotlib of Bokeh. To be able to call several plotting commands and customize the figures, both libraries require to call a command at the end to finish figure creation and show the generated plot. In matplotlib's case, it's matplotlib.pyplot.show()
and in Bokeh's case it's bokeh.plotting.show(plot)
.
When using ArviZ in an interactive manner (and therefore barely customizing ArviZ generated plots), ArviZ can be configured to automatically show all generated plots by doing:
import arviz as az
az.rcParams["plot.matplotlib.show"] = True # bokeh plots are automatically shown by default
This will make pm.traceplot
automatically show the plot straight away. If this is a too general setting, there is also the option of using pm.traceplot(..., show=True)
on a per plot basis.

- 7,315
- 4
- 29
- 40
-
1This is the solution I needed! The plots are working beautifully :) Thank you for taking the time to answer my question. – MMB Apr 24 '20 at 14:58
-
Glad it was useful :) – OriolAbril Apr 24 '20 at 16:38