Skip to content

Commit 8caa5d1

Browse files
changing spelling of data frame name
Co-authored-by: Liam Connors <[email protected]>
1 parent 25d9a5b commit 8caa5d1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

doc/python/text-and-annotations.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -786,12 +786,9 @@ fig.show()
786786

787787
This example shows how to put a terse note about the data source or interpretation at the bottom of the figure. This example achieves the desired alignment in the bottom right corner using the title element and container coordinates and then uses an annotation to add a figure title. A near zero container coordinate is an easy and robust way to put text -- such as a source line or figure note -- at the bottom of a figure. It is easier to specify the bottom of the figure in container coordinates than in e.g. a paper coordinate since uncertainty about the size of legends and x-axis labels make the paper coordinate of the bottom of the figure uncertain. Making the y container coordinate very slightly positive avoids cutting off the descending strokes of letters like y, p, and q. Only the title command supports container coordinates, so this example repurposes the title element to insert the note and repurposes an annotation element for the title. The top of the figure is typically less cluttered and more predictable, so an annotation with its bottom at a paper y-coordinate slightly greater than 1 is a reasonable title location on many graphs.
788788

789-
```import plotly.express as px
790-
df_iris = px.data.iris()
791-
fig = px.scatter(df_iris, x="sepal_width", y="sepal_length", color="species",
792-
size='petal_length', hover_data=['petal_width'])
793-
794-
#Use the title for the source / note line
789+
```python
790+
import plotly.express as px
791+
df = px.data.iris()
795792
fig.update_layout(
796793
title=dict(text="Note: this is the Plotly title element.",
797794
# keeping this title string short avoids getting the text cut off in small windows

0 commit comments

Comments
 (0)