Matplotlib - John Hunter - EEG/EcoG Visualisation
Architecture-
Scripting Layer - pyplot
Artist layer - artist
Backend Layer - FigureCanvas , renderer , eventAGG - anti grain geometry
%matplotlib inline - magic function - cannot modify a figure once its rendered
%matplotlib notebook - can modify
series of data points called markers connected by straight lines
years=list(map(str, range(1980,2014)))
.columns, .index, .tolist()
represents cumulated totals using numbers or percentages over time
(kind=’area’)
represents frequency distribution of a variable
(kind=’hist’)
count, bin_edges=np.histogram(df[’2012’])
is used to compare the values of a variable at a given point in time
(kind=’bar’)
circular statistic graphic
(kind=’pie’)
(kind=’box’)
minimum = Q1 - 1.5 IQR
Q1 - 25%
Median
Q3 - 75%
Maximum = Q3 + 1.5 IQR
Outliers - individual dots
Displays two variables against each other
dependent x independent to find correlation
-Waffle chart - displays progres towards goals
converts a dataframe into tiles
Not builtin for matplotlib
-Word Cloud - depiction of frequency of words in textual data
Not builtin for matplotlib
Andreas Mueller - word cloud generator
Seaborn is based on matplotlib
-Regression plots
ax=sns.regplot(x='yar',y='total',data=df)
color,marker
Folium - leaflet maps(geospatial data)
longitudes and latitudes
world_map=folium.Map(location=[x,y],tiles='style',zoom_start=n)
canada_map=folium.Map(location=[56.130,-106.35])
ontario=folium.map.FeatureGroup()
ontario.add_child(folium.features.CircleMarker([51.25,-85.32],radius=5,color='red',fill_color='red'))
folium.Marker([51.25,-85.32],popup="Ontario").add_to(canada_map)
Chloropleth Maps - thematic maps in which areas are shaded
It requires a GeoJSON file
Folium enables binding of data to map for chloropleth visualizations as well as passing visualizations as markers on the map
It has built-in tilesets from OpenStreetMap, Mapbox, Stamen, Mapbox API Keys.
Dashboard
- Real time visuals
- KPI
- Decisions and Analysis
Web based dashboards - plotly dash, panel, voila, streamlit
Bokeh, ipywidgets, matplotlib, Flask, bowtie
Intro to Plotly
- available in python, R and JS
submodules
-plotly graph objects
-plotly express
Plotly dash
dash_core_components - interactive and are generates with JS, HTML, CSS, React
dash_html_components - has classes for every html tag
John Snow's data journalism: the cholera map that changed the world | Cholera | The Guardian
Dashboarding tools — PyViz 0.0.1 documentation
To learn more about using Plotly to create dashboards, explore
Plotly python
Plotly graph objects with example
Plotly express
API reference
Here are additional useful resources:
Plotly cheatsheet
Plotly community
Related blogs
Open-source datasets
Complete dash user guide
Dash core components
Dash HTML components
Dash community forum
Related blogs
Python decorators reference 1
Python decorators reference 2
Callbacks with example
Dash app gallery
Dash community components