Skip to content

new tutorial on displaying image data #163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Nov 12, 2019
Prev Previous commit
Next Next commit
minor changes
  • Loading branch information
emmanuelle authored and nicolaskruchten committed Nov 12, 2019
commit cc59b3cca2127a3f21ccda5bb81b9ebb56bc12a8
4 changes: 2 additions & 2 deletions python/imshow.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ img = data.astronaut()
# Increase contrast by clipping the data range between 50 and 200
fig = px.imshow(img, zmin=50, zmax=200)
# We customize the hovertemplate to show both the data and the color values
# See https://plot.ly/python/v3/hover-text-and-formatting/#hovertemplate
# See https://plot.ly/python/hover-text-and-formatting/#customize-tooltip-text-with-a-hovertemplate
fig.update_traces(hovertemplate="x: %{x} <br> y: %{y} <br> z: %{z} <br> color: %{color}")
fig.show()
```
Expand Down Expand Up @@ -176,7 +176,7 @@ from plotly.subplots import make_subplots
from skimage import data
img = data.chelsea()
fig = make_subplots(1, 2)
# We use go.Image because at the moment px functions are not compatible with subplots
# We use go.Image because subplots require traces, whereas px functions return a figure
fig.add_trace(go.Image(z=img), 1, 1)
for channel, color in enumerate(['red', 'green', 'blue']):
fig.add_trace(go.Histogram(x=img[..., channel].ravel(), opacity=0.5,
Expand Down