-
Notifications
You must be signed in to change notification settings - Fork 0
7 Plotly Tutorials
Suman Kumar Pal edited this page Jan 6, 2024
·
2 revisions
Documentation link: https://plotly.com/python/
GitHub - https://github.com/plotly
Plotly express file
Documentation link: https://plotly.com/python/plotly-express/
To import:
import plotly.express as px
import pandas as pdHere the datasets used are from the module pd.data.
-
scatter plots and discrete color (
.scatter) - trendlines and templates and marginal distribution plots
- eror bars
-
bar charts (
.bar) - facet plots
-
scatterplot matrices (
.scatter_matrix) -
parallel coordinates and parallel categories and continuous color (
.parallel_coordinatesand.parallel_categories) - hover labels
- animations
-
line charts (
.line) -
area charts (
.area) -
timeline/ Gantt charts (
.timeline) -
funnel charts (
.funnel)
Part to Whole Charts -
-
pie charts (
.pie) -
sunburst charts (
.sunburst) -
treemaps (
.treemap) -
icicle charts (
.icicle)
Distributions -
-
histograms (
.histogram) -
box plots (
.box) -
violin plots (
.violin) -
Empirical cumulative distribution function (ECDF) charts (
.ecdf) -
strip charts (
.strip) -
density contours or 2d histogram contours (
.density_contour) -
density heatmaps or 2d histograms (
.density_heatmap)
Images and Heatmaps (.imshow, from skimage import io)
Polar Coordinates -
-
polar plots (
.scatter_polar) -
radar charts (
.line_polar) -
polar bar charts (
.bar_polar)
3D Coordinates -
-
3D scatter plots (
.scatter_3d)
Ternary Coordinates (scatter_ternary)
Bash
Plotly graph objects file
Documentation Link: https://plotly.com/python/graph-objects/
To import:
import plotly.graph_objects as go- Comparing Graph Objects and Plotly Express
An example of code is given below -
fig = go.Figure()
fig.add_trace(go.Bar(x=, y=, name=, hovertemplate=))
fig.update_layout(legend_title_text = "")
fig.update_xaxes(title_text = "")
fig.update_yaxes(title_text = "")
fig.show()See this code in the file.
Don't click on file.
Created by Suman Kumar Pal.
GitHub profile: https://github.com/suman122003.