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.

Install

Hot:19

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-scientific-skills-plotly&locale=en&source=copy

Plotly - Python interactive data visualization library

Skill overview

Plotly is a powerful Python interactive visualization library that supports 40+ chart types. It makes it easy to create publication-quality charts with hover tooltips, zooming, and panning, and supports exporting as HTML for embedding in web pages.

Use cases

1. Data dashboards and web embedding

When you need to embed charts in a website or build interactive dashboards, Plotly is an ideal choice. The generated HTML charts are self-contained and can be embedded in any webpage. Users can view data details via hover, zoom into areas of interest, and toggle traces via the legend. Combined with the Dash framework, you can quickly build full web data applications.

2. Exploratory data analysis

During data analysis, Plotly’s interactivity lets you explore data in depth. Hover tooltips quickly show exact values, box/lasso selection lets you select specific points, and time-series range sliders enable focused inspection — these features help you discover patterns and anomalies in data, especially suited for analysts and scientists working with pandas DataFrame.

3. Presentations and scientific visualization

When creating charts for presentations, Plotly’s publication-quality output and rich chart types (3D surface plots, heatmaps, contour plots, financial candlestick charts, etc.) meet professional needs. It supports animations, buttons, and dropdown menus to make your presentation more dynamic. Note: for static publication figures (e.g., journal illustrations), it’s recommended to use Matplotlib or other scientific visualization tools.

Core features

1. Two-layer API design

Plotly provides two layers of API to meet different needs:

  • Plotly Express (px): a high-level API that creates common charts (scatter, line, bar, histogram, etc.) in 1–5 lines of code, automatically handling color encoding and legends, suitable for quick visualization.

  • Graph Objects (go): a low-level API that offers fine-grained control and supports advanced types like 3D meshes, isosurfaces, and complex financial charts, suitable when you need full customization.
  • 2. Rich interactive features

    All Plotly charts support rich interactivity by default:

  • Custom hover tooltip templates

  • Smooth zooming and panning

  • Toggling traces by clicking the legend

  • Box and lasso selection of data points

  • Time-series range sliders

  • Animations and interactive buttons
  • 3. Flexible export options

  • Interactive HTML: export to standalone HTML files that can be embedded in any webpage

  • Static images: export to PNG, PDF, SVG formats after installing kaleido, suitable for publication

  • Multi-chart layouts: use make_subplots to create dashboards with shared axes
  • Frequently asked questions

    What’s the difference between Plotly and Matplotlib? When should I use Plotly?

    Plotly focuses on interactive visualization — charts support hover, zoom, pan, etc., making it suitable for dashboards, web embedding, and exploratory analysis. Matplotlib excels at static publication-quality figures and is better for journal illustrations and situations requiring precise control over static plots. In short: choose Plotly for interactivity, choose Matplotlib for static publication.

    How do I create interactive charts with Plotly and embed them in a webpage?

    You can create charts with a few lines using Plotly Express:

    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='Interactive scatter plot')
    fig.write_html('chart.html')  # Export as HTML

    The generated HTML file can be directly embedded in a webpage or used with Dash to build complete web apps.

    Which should I choose, Plotly Express or Graph Objects?

    Prefer Plotly Express (px): in 90% of use cases, Express is simpler and faster, automatically handling colors, legends, layouts, and other details, and is especially convenient for users working with pandas DataFrame.

    Use Graph Objects (go) when needed: when you need chart types not supported by Express (e.g., 3D meshes, complex financial charts), or when you need fine control over every component. In practice, the Figure object returned by Express can be directly modified with go methods like fig.update_layout() or fig.add_hline(); the two can be combined flexibly.