.. This document is auto-generated by the altair-gallery extension. Do not modify directly.
.. _example-gallery:
Example Gallery
---------------
This gallery contains a selection of examples of the plots Altair can create. Some may seem fairly complicated at first glance, but they are built by combining a simple set of declarative building blocks.
Many draw upon sample datasets compiled by the `Vega `_ project. To access them yourself, install `vega_datasets `_.
.. code-block:: none
   python -m pip install vega_datasets
If you can't find the plots you are looking for here, make sure to check out the :ref:`altair-ecosystem` section, which has links to packages for making e.g. network diagrams and animations.
.. _gallery-category-Simple Charts:
Simple Charts
~~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Simple Bar Chart
   
   
   
   
     Simple Heatmap
   
   
   
   
     Simple Histogram
   
   
   
   
     Simple Line Chart
   
   
   
   
     Simple Scatter Plot with Tooltips
   
   
   
   
     Simple Stacked Area Chart
   
   
   
   
     Simple Strip Plot
   
   
   
   
.. _gallery-category-Bar Charts:
Bar Charts
~~~~~~~~~~
.. raw:: html
   
   
   
   
     Bar Chart Highlighting Values beyond a Threshold
   
   
   
   
     Bar Chart with Highlighted Bar
   
   
   
   
     Bar Chart with Highlighted Segment
   
   
   
   
     Bar Chart with Labels
   
   
   
   
     Bar Chart with Labels based on Measured Luminance
   
   
   
   
     Bar Chart with Line at Mean
   
   
   
   
     Bar Chart with Line on Dual Axis
   
   
   
   
     Bar Chart with Negative Values
   
   
   
   
     Bar Chart with Range
   
   
   
   
     Bar Chart with Rolling Mean
   
   
   
   
     Bar Chart with Rounded Edges
   
   
   
   
     Bar and Tick Chart
   
   
   
   
     Calculating Percentage of Total
   
   
   
   
     Compact Faceted Grid of Bar Charts
   
   
   
   
     Diverging Stacked Bar Chart
   
   
   
   
     Faceted Stacked Bar Chart
   
   
   
   
     Grouped Bar Chart
   
   
   
   
     Grouped Bar Chart with Error Bars
   
   
   
   
     Grouped Bar Chart with xOffset
   
   
   
   
     Grouped Bar Chart with xOffset and overlapping bars
   
   
   
   
     Horizontal Bar Chart
   
   
   
   
     Horizontal Grouped Bar Chart
   
   
   
   
     Horizontal Stacked Bar Chart
   
   
   
   
     Layered Bar Chart
   
   
   
   
     Normalized Stacked Bar Chart
   
   
   
   
     Sorted Bar Chart
   
   
   
   
     Stacked Bar Chart
   
   
   
   
     Stacked Bar Chart with Sorted Segments
   
   
   
   
     Stacked Bar Chart with Text Overlay
   
   
   
   
.. _gallery-category-Line Charts:
Line Charts
~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Bump Chart
   
   
   
   
     Filled Step Chart
   
   
   
   
     Line Chart with Arrows
   
   
   
   
     Line Chart with Cumulative Sum
   
   
   
   
     Line Chart with Custom Legend
   
   
   
   
     Line Chart with Custom Order
   
   
   
   
     Line Chart with Datum
   
   
   
   
     Line Chart with Datum for Color
   
   
   
   
     Line Chart with Interpolation
   
   
   
   
     Line Chart with Last Value Labeled
   
   
   
   
     Line Chart with Layered Aggregates
   
   
   
   
     Line Chart with Logarithmic Scale
   
   
   
   
     Line Chart with Percent axis
   
   
   
   
     Line Chart with Point Markers
   
   
   
   
     Line Chart with Sequence Generator
   
   
   
   
     Line Chart with Stroked Point Markers
   
   
   
   
     Line Chart with Varying Size
   
   
   
   
     Multiple Series Line Chart
   
   
   
   
     Slope Graph
   
   
   
   
     Step Chart
   
   
   
   
     Window Rank Line Chart
   
   
   
   
.. _gallery-category-Area Charts:
Area Charts
~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Area Chart with Gradient
   
   
   
   
     Faceted Area Chart
   
   
   
   
     Horizon Graph
   
   
   
   
     Layered Area Chart
   
   
   
   
     Normalized Stacked Area Chart
   
   
   
   
     Streamgraph
   
   
   
   
.. _gallery-category-Circular Plots:
Circular Plots
~~~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Donut Chart
   
   
   
   
     Pacman Chart
   
   
   
   
     Pie Chart
   
   
   
   
     Pie Chart with Labels
   
   
   
   
     Polar Bar Chart
   
   
   
   
     Radial Chart
   
   
   
   
.. _gallery-category-Scatter Plots:
Scatter Plots
~~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Brushing Scatter Plot to Show Data on a Table
   
   
   
   
     Bubble Plot
   
   
   
   
     Faceted Scatter Plot
   
   
   
   
     Multifeature Scatter Plot
   
   
   
   
     Scatter Matrix
   
   
   
   
     Scatter Plot with Href
   
   
   
   
     Scatter Plot with Minimap
   
   
   
   
     Scatter Plot with Rolling Mean
   
   
   
   
     Scatter Plot with Shaded Area
   
   
   
   
     Simple Scatter Plot with Labels
   
   
   
   
.. _gallery-category-Uncertainties And Trends:
Uncertainties And Trends
~~~~~~~~~~~~~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Error Bars with Confidence Interval
   
   
   
   
     Error Bars with Standard Deviation
   
   
   
   
     Line Chart with Confidence Interval Band
   
   
   
   
     Polynomial Fit Plot with Regression Transform
   
   
   
   
     Scatter Plot with LOESS Lines
   
   
   
   
     Simple Scatter Plot with Errorbars
   
   
   
   
.. _gallery-category-Distributions:
Distributions
~~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     2D Histogram Heatmap
   
   
   
   
     2D Histogram Scatter Plot
   
   
   
   
     Boxplot with Min/Max Whiskers
   
   
   
   
     Cumulative Count Chart
   
   
   
   
     Distributions and Medians of Likert Scale Ratings
   
   
   
   
     Dot Dash Plot
   
   
   
   
     Empirical Cumulative Distribution Function
   
   
   
   
     Faceted Histogram
   
   
   
   
     Heat Lane Chart
   
   
   
   
     Histogram with Gradient Color
   
   
   
   
     Histogram with Responsive Bins
   
   
   
   
     Histogram with a Global Mean Overlay
   
   
   
   
     Layered Histogram
   
   
   
   
     Quantile-Quantile Plot
   
   
   
   
     Repeated Density Estimates
   
   
   
   
     Ridgeline plot
   
   
   
   
     Scatter Plot with Faceted Marginal Histograms
   
   
   
   
     Stacked Density Estimates
   
   
   
   
     Strip Plot with Jitter
   
   
   
   
     Table Bubble Plot (Github Punch Card)
   
   
   
   
     Violin Plot
   
   
   
   
.. _gallery-category-Tables:
Tables
~~~~~~
.. raw:: html
   
   
   
   
     Annual Weather Heatmap
   
   
   
   
     Hexbin Chart
   
   
   
   
     Lasagna Plot (Dense Time-Series Heatmap)
   
   
   
   
     Mosaic Chart with Labels
   
   
   
   
     Text over a Heatmap
   
   
   
   
.. _gallery-category-Maps:
Maps
~~~~
.. raw:: html
   
   
   
   
     Choropleth Map
   
   
   
   
     Grouped Points with Proportional Symbols Map
   
   
   
   
     Point map
   
   
   
   
     Repeated Choropleth Map
   
   
   
   
     US Income by State: Wrapped Facet
   
   
   
   
     Wind Vector Map
   
   
   
   
     World Map
   
   
   
   
     World Projections
   
   
   
   
.. _gallery-category-Interactive Charts:
Interactive Charts
~~~~~~~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Bar Chart with Highlighting on Hover and Selection on Click
   
   
   
   
     Interactive Average
   
   
   
   
     Interactive Chart with Aggregation
   
   
   
   
     Interactive Chart with Cross-Highlight
   
   
   
   
     Interactive Crossfilter
   
   
   
   
     Interactive Legend
   
   
   
   
     Interactive Rectangular Brush
   
   
   
   
     Interactive Scatter Plot and Linked Layered Histogram
   
   
   
   
     Interactive Selection of Columns
   
   
   
   
     Interval Selection on a Map
   
   
   
   
     Interval Selection with Initial Date Range
   
   
   
   
     Multi-Line Highlight
   
   
   
   
     Multi-Line Tooltip
   
   
   
   
     Multi-Line Tooltip (Standard)
   
   
   
   
     Multi-panel Scatter Plot with Linked Brushing
   
   
   
   
     Multiple Interactions
   
   
   
   
     Reorder stacked bar segments
   
   
   
   
     Scatter Plot and Histogram with Interval Selection
   
   
   
   
     Scatter plot with point paths on hover with search box
   
   
   
   
     Selection Detail
   
   
   
   
     Selection Histogram
   
   
   
   
     Selection zorder
   
   
   
   
     Simple Interactive Colored Scatter Plot
   
   
   
   
     Slider Cutoff
   
   
   
   
     Using Selection Interval with mark_area
   
   
   
   
.. _gallery-category-Advanced Calculations:
Advanced Calculations
~~~~~~~~~~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Calculate Residuals
   
   
   
   
     Candlestick Chart
   
   
   
   
     Comet Chart
   
   
   
   
     Faceted Line Chart with Cumulative Sum
   
   
   
   
     Gantt Chart
   
   
   
   
     Isotype Grid
   
   
   
   
     Isotype Visualization
   
   
   
   
     Isotype Visualization with Emoji
   
   
   
   
     Layered chart with Dual-Axis
   
   
   
   
     Normalized Parallel Coordinates
   
   
   
   
     Parallel Coordinates
   
   
   
   
     Ranged Dot Plot
   
   
   
   
     Sorted Error Bars showing Confidence Interval
   
   
   
   
     Stem and Leaf Plot
   
   
   
   
     Top K Items
   
   
   
   
     Top K Letters
   
   
   
   
     Top-K Plot with Others
   
   
   
   
     Waterfall Chart
   
   
   
   
     Wilkinson Dot Plot
   
   
   
   
.. _gallery-category-Case Studies:
Case Studies
~~~~~~~~~~~~
.. raw:: html
   
   
   
   
     Anscombe's Quartet
   
   
   
   
     Atmospheric CO2 Concentration
   
   
   
   
     Becker's Barley Faceted Plot
   
   
   
   
     Becker's Barley Wrapped Facet Plot
   
   
   
   
     Connections Among U.S. Airports Interactive
   
   
   
   
     Dendrogram of Hierarchical Clustering
   
   
   
   
     Gapminder Bubble Plot
   
   
   
   
     Global Deaths from Natural Disasters
   
   
   
   
     Iowa's Renewable Energy Boom
   
   
   
   
     London Tube Lines
   
   
   
   
     One Dot Per Zipcode
   
   
   
   
     Population of Falkensee from 1875 to 2014
   
   
   
   
     Pyramid Pie Chart
   
   
   
   
     Seattle Weather Interactive
   
   
   
   
     The U.S. Employment Crash During the Great Recession
   
   
   
   
     U.S. State Capitals Overlayed on a Map of the U.S
   
   
   
   
     US Population Pyramid Over Time
   
   
   
   
     US Population by Age and Sex
   
   
   
   
     US Population: Wrapped Facet
   
   
   
   
     Wheat and Wages
   
   
   
   
.. toctree::
   :maxdepth: 2
   :caption: Examples
   :hidden:
   Gallery 
   Tutorials <../case_studies/index>