Skip to content

Commit 682424f

Browse files
fix tests
1 parent e8b862b commit 682424f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Diff for: doc/python/imshow.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.2'
9-
jupytext_version: 1.3.0
9+
jupytext_version: 1.4.2
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.3
23+
version: 3.7.7
2424
plotly:
2525
description: How to display image data in Python with Plotly.
2626
display_as: scientific
@@ -70,8 +70,8 @@ fig.show()
7070
import plotly.express as px
7171
from skimage import data
7272
img = data.astronaut()
73-
fig = px.imshow(img)
74-
fig.show()
73+
fig = px.imshow(img, binary_format="jpeg", binary_compression_level=0)
74+
fig.show("notebook")
7575
```
7676

7777
### Display single-channel 2D data as a heatmap
@@ -94,7 +94,7 @@ You can customize the [continuous color scale](/python/colorscales/) just like w
9494
import plotly.express as px
9595
import numpy as np
9696
img = np.arange(100).reshape((10, 10))
97-
fig = px.imshow(img, color_continuous_scale='Viridis')
97+
fig = px.imshow(img, binary_string=True)
9898
fig.show()
9999
```
100100

Diff for: packages/python/plotly/plotly/tests/test_io/test_renderers.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -304,17 +304,17 @@ def test_repr_html(renderer):
304304
id_html = str_html.split('document.getElementById("')[1].split('")')[0]
305305
id_pattern = "cd462b94-79ce-42a2-887f-2650a761a144"
306306
template = (
307-
'<div>\n \n <script type="text/javascript">'
308-
"window.PlotlyConfig = {MathJaxConfig: 'local'};</script>\n "
309-
'<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> \n '
307+
'<div> <script type="text/javascript">'
308+
"window.PlotlyConfig = {MathJaxConfig: 'local'};</script> "
309+
'<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> '
310310
'<div id="cd462b94-79ce-42a2-887f-2650a761a144" class="plotly-graph-div" '
311-
'style="height:100%; width:100%;"></div>\n <script type="text/javascript">'
312-
"\n \n window.PLOTLYENV=window.PLOTLYENV || {};"
313-
'\n \n if (document.getElementById("cd462b94-79ce-42a2-887f-2650a761a144"))'
314-
" {\n Plotly.newPlot(\n 'cd462b94-79ce-42a2-887f-2650a761a144',"
315-
'\n [],\n {"template": {}},'
316-
'\n {"responsive": true}\n )\n };'
317-
"\n \n </script>\n </div>"
311+
'style="height:100%; width:100%;"></div> <script type="text/javascript">'
312+
" window.PLOTLYENV=window.PLOTLYENV || {};"
313+
' if (document.getElementById("cd462b94-79ce-42a2-887f-2650a761a144"))'
314+
" { Plotly.newPlot( 'cd462b94-79ce-42a2-887f-2650a761a144',"
315+
' [], {"template": {}},'
316+
' {"responsive": true} ) };'
317+
" </script> </div>"
318318
)
319319
if "text/html" in bundle:
320320
str_bundle = bundle["text/html"]

0 commit comments

Comments
 (0)