Skip to main content Home Creators synthetic-sciences openscience plotly
plotly Interactive visualization library. Use when you need hover info, zoom, pan, or web-embeddable charts. Best for dashboards, exploratory analysis, and presentations. For static publication figures use matplotlib or scientific-visualization.
Jump to install Skills Marketplace Discover and explore AI skills built by the community.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Copy promptShow prompt details A direct command skips the review prompt. Inspect the source before running it.
npx skills add https://github.com/synthetic-sciences/openscience --skill plotlyThe command stays on one line. Scroll horizontally to inspect it before copying.
Prefer a local copy? Download the files currently available to SkillsMP.
Download Zip Downloading... More from this repository
Related occupations SOC
Based on SOC occupation classification
name plotly description Interactive visualization library. Use when you need hover info, zoom, pan, or web-embeddable charts. Best for dashboards, exploratory analysis, and presentations. For static publication figures use matplotlib or scientific-visualization. category visualization license MIT license metadata {"skill-author":"Synthetic Sciences"} version 1.0.0 author Synthetic Sciences tags ["Visualization","Interactive","Dashboards","Charts"] dependencies ["plotly>=5.22.0"]
Plotly
Python graphing library for creating interactive, publication-quality visualizations with 40+ chart types.
Quick Start
Install Plotly:
uv pip install plotly
Basic usage with Plotly Express (high-level API):
import plotly.express as px
import pandas as pd
df = pd.DataFrame({
'x' : [1 , 2 , 3 , 4 ],
'y' : [10 , 11 , 12 , 13 ]
})
fig = px.scatter(df, x='x' , y='y' , title='My First Plot' )
fig.show()
Choosing Between APIs
Use Plotly Express (px)
For quick, standard visualizations with sensible defaults:
Working with pandas DataFrames
Creating common chart types (scatter, line, bar, histogram, etc.)
Need automatic color encoding and legends
Want minimal code (1-5 lines)
See reference/plotly-express.md for complete guide.
Use Graph Objects (go)
For fine-grained control and custom visualizations:
Chart types not in Plotly Express (3D mesh, isosurface, complex financial charts)
Building complex multi-trace figures from scratch
Need precise control over individual components
Creating specialized visualizations with custom shapes and annotations
See reference/graph-objects.md for complete guide.
Note: Plotly Express returns graph objects Figure, so you can combine approaches:
fig = px.scatter(df, x='x' , y='y' )
fig.update_layout(title='Custom Title' )
fig.add_hline(y=10 )
Core Capabilities
1. Chart Types Plotly supports 40+ chart types organized into categories:
Basic Charts: scatter, line, bar, pie, area, bubble
Statistical Charts: histogram, box plot, violin, distribution, error bars
Scientific Charts: heatmap, contour, ternary, image display
Financial Charts: candlestick, OHLC, waterfall, funnel, time series
Maps: scatter maps, choropleth, density maps (geographic visualization)
3D Charts: scatter3d, surface, mesh, cone, volume
Specialized: sunburst, treemap, sankey, parallel coordinates, gauge
2. Layouts and Styling Subplots: Create multi-plot figures with shared axes:
from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(rows=2 , cols=2 , subplot_titles=('A' , 'B' , 'C' , 'D' ))
fig.add_trace(go.Scatter(x=[1 , 2 ], y=[3 , 4 ]), row=1 , col=1 )
Templates: Apply coordinated styling:
fig = px.scatter(df, x='x' , y='y' , template='plotly_dark' )
Customization: Control every aspect of appearance:
Colors (discrete sequences, continuous scales)
Fonts and text
Axes (ranges, ticks, grids)
Legends
Margins and sizing
Annotations and shapes
3. Interactivity Built-in interactive features:
Hover tooltips with customizable data
Pan and zoom
Legend toggling
Box/lasso selection
Rangesliders for time series
Buttons and dropdowns
Animations
fig.update_traces(
hovertemplate='<b>%{x}</b><br>Value: %{y:.2f}<extra></extra>'
)
fig.update_xaxes(rangeslider_visible=True )
fig = px.scatter(df, x='x' , y='y' , animation_frame='year' )
4. Export Options fig.write_html('chart.html' )
fig.write_html('chart.html' , include_plotlyjs='cdn' )
Static Images (requires kaleido):
fig.write_image('chart.png' )
fig.write_image('chart.pdf' )
fig.write_image('chart.svg' )
Common Workflows
Scientific Data Visualization import plotly.express as px
fig = px.scatter(df, x='temperature' , y='yield' , trendline='ols' )
fig = px.imshow(correlation_matrix, text_auto=True , color_continuous_scale='RdBu' )
import plotly.graph_objects as go
fig = go.Figure(data=[go.Surface(z=z_data, x=x_data, y=y_data)])
Statistical Analysis
fig = px.histogram(df, x='values' , color='group' , marginal='box' , nbins=30 )
fig = px.box(df, x='category' , y='value' , points='all' )
fig = px.violin(df, x='group' , y='measurement' , box=True )
Time Series and Financial
fig = px.line(df, x='date' , y='price' )
fig.update_xaxes(rangeslider_visible=True )
import plotly.graph_objects as go
fig = go.Figure(data=[go.Candlestick(
x=df['date' ],
open =df['open' ],
high=df['high' ],
low=df['low' ],
close=df['close' ]
)])
Multi-Plot Dashboards from plotly.subplots import make_subplots
import plotly.graph_objects as go
fig = make_subplots(
rows=2 , cols=2 ,
subplot_titles=('Scatter' , 'Bar' , 'Histogram' , 'Box' ),
specs=[[{'type' : 'scatter' }, {'type' : 'bar' }],
[{'type' : 'histogram' }, {'type' : 'box' }]]
)
fig.add_trace(go.Scatter(x=[1 , 2 , 3 ], y=[4 , 5 , 6 ]), row=1 , col=1 )
fig.add_trace(go.Bar(x=['A' , 'B' ], y=[1 , 2 ]), row=1 , col=2 )
fig.add_trace(go.Histogram(x=data), row=2 , col=1 )
fig.add_trace(go.Box(y=data), row=2 , col=2 )
fig.update_layout(height=800 , showlegend=False )
Integration with Dash For interactive web applications, use Dash (Plotly's web app framework):
import dash
from dash import dcc, html
import plotly.express as px
app = dash.Dash(__name__)
fig = px.scatter(df, x='x' , y='y' )
app.layout = html.Div([
html.H1('Dashboard' ),
dcc.Graph(figure=fig)
])
app.run_server(debug=True )
Reference Files
Additional Resources