Elaborate on difference between Plotly Express and Graph Objects functions#5150
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello! I teach Plotly in one of my classes, and as I was reading through this documentation, I felt it could be more explicit about how data is passed into the different plotting functions.
Thanks!
Documentation PR
doc/README.md
filedoc-prod
branchOR it targets themain
branchIf this PR modifies the first example in a page or adds a new one, it is apx
example if at all possibleEvery new/modified example has a descriptive title and motivating sentence or paragraphEvery new/modified example is independently runnableEvery new/modified example is optimized for short line count and focuses on the Plotly/visualization-related aspects of the example rather than the computation required to produce the data being visualizedMeaningful/relatable datasets are used for all new examples instead of randomly-generated data where possibleThe random seed is set if using randomly-generated data in new/modified examplesNew/modified remote datasets are loaded from https://plotly.github.io/datasets and added to https://github.com/plotly/datasetsLarge computations are avoided in the new/modified examples in favour of loading remote datasets that represent the output of such computationsImports areplotly.graph_objects as go
/plotly.express as px
/plotly.io as pio
Data frames are always calleddf
fig = <something>
call is high up in each new/modified example (eitherpx.<something>
ormake_subplots
orgo.Figure
)Liberal use is made offig.add_*
andfig.update_*
rather thango.Figure(data=..., layout=...)
in every new/modified exampleSpecific adders and updaters likefig.add_shape
andfig.update_xaxes
are used instead of bigfig.update_layout
calls in every new/modified examplefig.show()
is at the end of each new/modified exampleplotly.plot()
andplotly.iplot()
are not used in any new/modified exampleHex codes for colors are not used in any new/modified example in favour of these nice ones