Skip to content

Commit 87c9a10

Browse files
committed
Correct examples and text
1 parent cbe9b40 commit 87c9a10

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

doc/python/2D-Histogram.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fig.show()
238238
### Text on 2D Histogram Points
239239

240240

241-
In this example we add text to 2D-Histogram points. We use the values from the `z` attribute for the text, adding them following the format **%{variable}**.
241+
In this example we add text to 2D Histogram points. We use the values from the `z` attribute for the text.
242242

243243
```python
244244
import plotly.graph_objects as go

doc/python/heatmaps.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,16 @@ In this example we add text to heatmap points. We use the values from the `text`
204204

205205
```python
206206
import plotly.graph_objects as go
207-
from plotly import data
208207

209-
df = data.tips()
208+
fig = go.Figure(data=go.Heatmap(
209+
z=[[1, 20, 30],
210+
[20, 1, 60],
211+
[30, 60, 1]],
212+
text=[['one', 'twenty', 'thirty'],
213+
['twenty', 'one', 'sixty'],
214+
['thirty', 'sixty', 'one']],
215+
texttemplate="%{text}"))
210216

211-
fig = go.Figure(go.Histogram2d(
212-
x=df.total_bill,
213-
y=df.tip,
214-
texttemplate= "%{z}"
215-
))
216217
fig.show()
217218
```
218219

0 commit comments

Comments
 (0)