.. math:: y=f(t)
.. code-block:: python
-
- >>> import matplotlib.pyplot as plt
- >>>
- >>> t = range(50)
- >>> x = (ran.rand(50)*50) + 2000 # I don't have real data
- >>> plt.plot(t, x)
- >>> plt.title('Some time series with left title', loc='left')
- >>> plt.ylabel('Mass of test mass over time')
- >>> plt.show()
+ :include: time_series.py
Subplots
--------
.. code-block:: python
:include: subplot.py
- :end-at: ax.set_xlabel('XLabel0')
+
+Saving Plots
+------------
+
+So far I've just displayed plots with ``plt.sow()``. You can actually save
+the plots from that interface manually, but when scripting, it's convenient
+to do so automatically:
.. code-block:: python
- :include: subplot.py
- :start-at: for i in range(3):
+
+ >>> # Some plotting has previously occured
+ >>> plt.savefig('eggs.pdf', dpi=300, transparent=False)
+
+The output format is interpreted from the file extension.
+The keyword arguments are optional here. Other options exist.
+
+Error Bars
+----------
+
+Stacked Bar Graph
+-----------------
+
+.. code-block:: python
+ :include: stacked_bars.py