File tree 3 files changed +20
-5
lines changed
packages/python/plotly/plotly
3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 283
283
],
284
284
title = ["str" , "The figure title." ],
285
285
template = [
286
- "str or Plotly.py template object " ,
286
+ "or dict or plotly.graph_objects.layout.Template instance " ,
287
287
"The figure template name or definition." ,
288
288
],
289
289
width = ["int (default `None`)" , "The figure width in pixels." ],
Original file line number Diff line number Diff line change @@ -97,7 +97,9 @@ def imshow(
97
97
98
98
color_continuous_scale : str or list of str
99
99
colormap used to map scalar data to colors (for a 2D image). This parameter is
100
- not used for RGB or RGBA images.
100
+ not used for RGB or RGBA images. If a string is provided, it should be the name
101
+ of a known color scale, and if a list is provided, it should be a list of CSS-
102
+ compatible colors.
101
103
102
104
color_continuous_midpoint : number
103
105
If set, computes the bounds of the continuous color scale to have the desired
@@ -107,6 +109,18 @@ def imshow(
107
109
If provided, overrides auto-scaling on the continuous color scale, including
108
110
overriding `color_continuous_midpoint`.
109
111
112
+ title : str
113
+ The figure title.
114
+
115
+ template : str or dict or plotly.graph_objects.layout.Template instance
116
+ The figure template name or definition.
117
+
118
+ width : number
119
+ The figure width in pixels.
120
+
121
+ height: number
122
+ The figure height in pixels, defaults to 600.
123
+
110
124
Returns
111
125
-------
112
126
fig : graph_objects.Figure containing the displayed image
Original file line number Diff line number Diff line change @@ -50,9 +50,10 @@ def test_origin():
50
50
51
51
def test_colorscale ():
52
52
fig = px .imshow (img_gray )
53
- assert fig .data [0 ].colorscale [0 ] == (0.0 , "rgb(0, 0, 0)" )
54
- fig = px .imshow (img_gray , colorscale = "Viridis" )
55
- assert fig .data [0 ].colorscale [0 ] == (0.0 , "#440154" )
53
+ plasma_first_color = px .colors .sequential .Plasma [0 ]
54
+ assert fig .layout .coloraxis1 .colorscale [0 ] == (0.0 , plasma_first_color )
55
+ fig = px .imshow (img_gray , color_continuous_scale = "Viridis" )
56
+ assert fig .layout .coloraxis1 .colorscale [0 ] == (0.0 , "#440154" )
56
57
57
58
58
59
def test_wrong_dimensions ():
You can’t perform that action at this time.
0 commit comments