Path: blob/master/lessons/lesson_12/python-notebooks-data-wrangling/Basic visualization concepts in Matplotlib.ipynb
1904 views
Kernel: Python 3
Draft Contents
Making a chart Saving to file
Changing the characteristics of the line - color - width - pattern
Creating different chart types
Adjusting the axes
Changing the limits
Labeling the axes
Changing tick frequency
Changing the background
Annotating the chart points
Labeling the data and the chart
Changing spacing
Bucketing
Loading the data
In [5]:
In [6]:
Here's what the data looks like; because the CSV text format does not indicate whether '285.2'
is intended to be a float or a string literal, the data deserializes as a bunch of strings:
In [7]:
Out[7]:
[{'co2_ppm_mean': '285.2', 'year': '1850'},
{'co2_ppm_mean': '285.1', 'year': '1851'},
{'co2_ppm_mean': '285.0', 'year': '1852'},
{'co2_ppm_mean': '285.0', 'year': '1853'},
{'co2_ppm_mean': '284.9', 'year': '1854'}]
As it turns out, MPL's plotting handles the numerical-values-as-strings without a hitch (for now):
In [11]:
Out[11]:
Axes limits
In [22]:
Out[22]:
(1860, 1900)
In [25]:
Out[25]:
(1900, 2000)
In [26]:
In [ ]: