Data Visualization (UCSD) Flashcards
difference between explorative and declarative data viz
explorative - doesn’t need to be polished, just for exploring; declarative - presenting findings
goals for data viz
trustworthy, accessible, elegant
Plot a basic bar chart using column ‘year’ for X axis and ‘values’ for y-axis, from df ‘stage”
plt. bar( stage[‘year’], stage[‘values’] )
plt. show()
Plot a basic line chart using column ‘year’ for x axis and ‘values’ for y-axis, from df ‘stage”
plt. line( stage[‘year’], stage[‘values’])
plt. show()
Label the axes on a plot
plt. xlabel(‘Year’)
plt. ylabel(stage[‘IndicatorName’].iloc[0]) ## gets value from df in that col
label the figure
plt.title(‘CO2 Emissions in USA’)
start they y axis at 0
plt.axis([1959, 2011,0,25])
plot a histogram
hist_data = stage[‘Value’].values
plt.hist(hist_data, 10, density=False, facecolor=’green’)
What is the folium package
Allows you to do geographic overlays of data
When to use seaborn package?
Specialized statistical plots, like automatically fitting a linear regression with confidence interval or like scatter plots color-coded by category
packages with easier interfaces for plotting?
ggplot or altair
packages for interactive plots that can be exported as javascript
bokeh, plotly
package for realtime plots that update with streaming data
bokeh plot server
package for 3d plots
mplot3d