How to Embed Interactive Python Charts in a Website
Export Plotly, Altair, Bokeh and pyecharts charts as HTML fragments, put them in your own page or blog, and choose between fragments and iframes.
Export Plotly, Altair, Bokeh and pyecharts charts as HTML fragments, put them in your own page or blog, and choose between fragments and iframes.
Prepare data in Python and draw it with D3.js: write a standalone HTML file, or build a Jupyter widget with anywidget that sends clicks back to Python.
Build interactive Apache ECharts charts from Python with pyecharts: bar, line, donut and calendar charts, English labels, themes, JavaScript formatters and export.
Replace df.plot with df.hvplot for interactive charts: lines, bars, histograms, small multiples, overlays, widgets and large datasets.
Make your first Bokeh plot, understand figures, glyphs and data sources, save the result as HTML, and find the tutorial for each task.
Pan several Bokeh plots together, select points in one and highlight them in another, share a crosshair, and add a slider that runs in the browser.
Show data on hover in Bokeh: pick columns, format numbers and dates, follow the x position on line charts, and write custom HTML tooltips.
Categorical bar charts in Bokeh: vertical, horizontal, sorted, labeled, colored by category, grouped and stacked.
Draw single and multiple lines in Bokeh, format a date axis, click the legend to hide lines, and add bands, steps and gaps.
Plot Polars DataFrames with df.plot (Altair), hvPlot, Plotly, Seaborn, or Matplotlib
Put a data table under or beside a Matplotlib chart with ax.table(), then control its size, fonts, colors, and column widths.
Zoom, pan, add sliders, and respond to clicks on Matplotlib figures in JupyterLab, Notebook, VS Code, and Colab with ipympl.
Make Matplotlib charts for dark slides, dashboards, and websites with dark_background, a custom dark theme, and light and dark exports from one function.
Plot vector fields in Matplotlib: arrows on a grid with ax.quiver() and continuous flow lines with ax.streamplot().
Add stripes, crosses, and dots to bars, areas, and pie wedges with the hatch argument, and control the pattern's color, density, and line width.
Draw values that hold and then jump with ax.step() and ax.stairs(), and show discrete samples with ax.stem().
Show the density of thousands of points with ax.hexbin() and ax.hist2d(), with log color scales, marginal histograms, and per-bin averages.
Add a small chart inside a Matplotlib chart with inset_axes(), zoom into one region, and draw connector lines with indicate_inset_zoom().
Skip an empty range on the y-axis or x-axis by splitting a Matplotlib chart into two subplots with different limits and drawing the break marks.
Use set_aspect() to give x and y the same scale, set_box_aspect() to fix the shape of the plot, and know which one you need.