Lines on traceplot

Is there an easy way to add lines to a traceplot:

pm.traceplot(trace,  var_names = ["mu","sd"], lines={'mu':2,"sd":1})

The argument “lines =” appears to no longer work.
it used to be supported in pymc3.
Is there a very easy alternative since I am new to both python and PYMC3.
I am following Osvaldo Martin’s book which also uses similar code. thanks in advance.

1 Like

The formatting of the lines argument was modified to be more flexible, I have several examples of using the lines argument in my blog ArviZ in depth: plot_trace | Oriol unraveled.

I would also recommend using arviz explicitly az.plot_trace or if you want to avoid adding a new namespace to your code, use the aliases to arviz functions provided by pymc3 (make sure to install the latest version), pm.plot_trace.

1 Like

Thanks Oriol, I will use az.plot_trace as you suggested. I look forward to studying your Blog on Traceplot. Your blog looks brialiant and makes a good starting point for the novice. I hope you sometime write something similar for Post Predictive Checks in a simple form that a novice can understand. thank you again for your help.

2 Likes