Skip to content

Commit eca5ce4

Browse files
committed
Trying to get plotly to work
1 parent 3fd2816 commit eca5ce4

File tree

3 files changed

+161
-142
lines changed

3 files changed

+161
-142
lines changed

examples/case_studies/bayesian_workflow.ipynb

Lines changed: 151 additions & 140 deletions
Large diffs are not rendered by default.

examples/case_studies/bayesian_workflow.myst.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,13 @@ import pymc as pm
5252
5353
from plotly.subplots import make_subplots
5454
55-
pio.renderers.default = "sphinx_gallery"
55+
# Set renderer to generate static images
56+
pio.renderers.default = "png"
57+
58+
# Configure image size and quality
59+
pio.kaleido.scope.default_width = 800
60+
pio.kaleido.scope.default_height = 600
61+
pio.kaleido.scope.default_scale = 2
5662
5763
warnings.simplefilter("ignore")
5864
@@ -151,6 +157,7 @@ fig = px.line(
151157
title=f"{country} - COVID-19 Cases",
152158
labels={"days_since_100": "Days since 100 cases", "confirmed": "Confirmed cases"},
153159
)
160+
fig.show()
154161
```
155162

156163
Look at the above plot and think about what type of model you would build to capture this pattern. What mathematical function might describe this growth?
@@ -619,7 +626,7 @@ fig.add_trace(
619626
yaxis_title="Confirmed cases (log scale)",
620627
yaxis_type="log",
621628
template="plotly_white",
622-
)
629+
).show()
623630
```
624631

625632
OK, that does not look terrible; the data essentially behaves like a random draw from the model.

pixi.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ plotly = ">=6.1.2,<7"
3333

3434
[pypi-dependencies]
3535
pymc-extras = ">=0.2.0, <0.3"
36+
kaleido = ">=1.0.0, <2"

0 commit comments

Comments
 (0)