Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Battle of the Data Visualization (Plotting) Libraries

Time Series data

import pandas as pd
import numpy as np

from bokeh.sampledata import stocks

index = pd.DatetimeIndex(stocks.AAPL['date'])
stock_df = pd.DataFrame({'IBM': stocks.IBM['close'], 'AAPL': stocks.AAPL['close']}, index=index)

Plot 1. Compare the time series

Categorical data

from toolkit import get_mesa_cfs

df = get_mesa_cfs()

accidents = df[df['Event Type Description'].str.contains('ACCIDENT')].reset_index()
accidents = accidents.groupby(['Event Type Description', pd.DatetimeIndex(accidents.call_dt).day_name()]).size().reset_index(name='counts')

Plot 2. Compare frequency of different accident calls by day of the week

Geographical data

from bokeh.sampledata.us_counties import data as counties
from bokeh.sampledata.unemployment import data as unemployment

counties = [dict(county, Unemployment=unemployment[cid])
            for cid, county in counties.items()
            if county["state"] == "az"]

df = pd.DataFrame(counties)

Plot 3. Compare Arizona Unemployment by County using geographic coordinates.

Multivariate data

from bokeh.sampledata.iris import flowers

iris_df = pd.DataFrame(flowers)

Plot 4. Compare everything (Scatter Matrix)

Temporal data

phx_df = pd.read_csv('data/phoenix_maximum_daily_temps.csv')

Plot 5. Make a Ridgeline plot or something comparable.

Gridded data

x, y = np.meshgrid(range(-5, 5), range(-5, 5))
z = x ** 2 + y ** 2
src = np.stack((x, y, z))

Plot 6. Plot the image (n-d array).

Demonstrate a few cool additional plots or visualizations of your own choosing below.

You can’t perform that action at this time.