File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
src/easydiffraction/plotting/plotters Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change 12
12
display = None
13
13
HTML = None
14
14
15
- from easydiffraction .utils .utils import is_notebook
16
15
from easydiffraction .utils .utils import is_pycharm
17
16
18
17
from .plotter_base import SERIES_CONFIG
@@ -107,21 +106,20 @@ def plot(
107
106
108
107
# Show the figure
109
108
110
- # This can lead to warnings in Jupyter notebooks:
111
- # WARNING: skipping unknown output mime type: application/vnd.plotly.v1+json [mystnb.unknown_mime_type]
112
- if is_notebook () or is_pycharm () or display is None or HTML is None :
113
- fig .show (config = config )
109
+ # The standard `fig.show()` method method triggers the following
110
+ # warning during the DMSC Summer School 2025 book build process:
111
+ # WARNING: skipping unknown output mime type:
112
+ # application/vnd.plotly.v1+json [mystnb.unknown_mime_type]
113
+ # So, instead, we will use `pio.to_html()` to convert the figure
114
+ # to HTML and keep `fig.show()` in PyCharm only.
114
115
115
- # If IPython is available, we can convert the figure to HTML and
116
- # display it in the notebook.
116
+ if is_pycharm () or display is None or HTML is None :
117
+ fig . show ( config = config )
117
118
else :
118
- # Convert figure to HTML
119
119
html_fig = pio .to_html (
120
120
fig ,
121
121
include_plotlyjs = 'cdn' ,
122
122
full_html = False ,
123
123
config = config ,
124
124
)
125
-
126
- # Display it in the notebook
127
125
display (HTML (html_fig ))
You can’t perform that action at this time.
0 commit comments