8000 tweaking of Plotly Express vs. Graph Objects wording · plotly/plotly.py@7cafb62 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7cafb62

Browse files
afeldemilykl
andauthored
tweaking of Plotly Express vs. Graph Objects wording
Co-authored-by: Emily KL <4672118+emilykl@users.noreply.github.com>
1 parent 84c7f4a commit 7cafb62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/python/graph-objects.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Note that the figures produced by Plotly Express **in a single function-call** a
6868

6969
The figures produced by Plotly Express can always be built from the ground up using graph objects, but this approach typically takes **5-100 lines of code rather than 1**.
7070

71-
Here is a simple example of how to produce the same figure object from the same data, once with Plotly Express and once without. Note that [Plotly Express functions](/python-api-reference/plotly.express.html) like [`px.bar()`](/python/bar-charts/) accept a DataFrame and names of columns as the `x` and `y` arguments, while [Graph Objects functions](/python-api-reference/plotly.graph_objects.html) like [`go.Bar()`](/python/bar-charts/#basic-bar-charts-with-plotlygraphobjects) require the values to be passed to the `x` and `y` as a Series/list.
71+
Here is a simple example of how to produce the same figure object from the same data, once with Plotly Express and once without. Note that [Plotly Express functions](/python-api-reference/plotly.express.html) like [`px.bar()`](/python/bar-charts/) can accept a DataFrame as their first argument with column names passed to the `x` and `y` arguments, while [Graph Objects functions](/python-api-reference/plotly.graph_objects.html) like [`go.Bar()`](/python/bar-charts/#basic-bar-charts-with-plotlygraphobjects) require the data values to be passed directly to the `x` and `y` arguments as a tuple, list, NumPy array, or Pandas Series.
7272

7373
The data in this example is in "long form" but [Plotly Express also accepts data in "wide form"](/python/wide-form/) and the line-count savings from Plotly Express over graph objects are comparable. More complex figures such as [sunbursts](/python/sunburst-charts/), [parallel coordinates](/python/parallel-coordinates-plot/), [facet plots](/python/facet-plots/) or [animations](/python/animations/) require many more lines of figure-specific graph objects code, whereas switching from one representation to another with Plotly Express usually involves changing just a few characters.
7474

0 commit comments

Comments
 (0)
0