Skip to content

Commit

Permalink
Update README.rst
Browse files Browse the repository at this point in the history
Added examples
  • Loading branch information
tisimst committed Jul 29, 2013
1 parent 84eb063 commit 729f5bd
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.rst
Expand Up @@ -13,6 +13,40 @@ Features
- Limit line: follows the inputs of the `matplotlib.axes.Axes.axhline`_ function.
- Put the chart on **arbitrary axes**.

Basic Examples
--------------
::

# plot data using the indices as labels
data = [21, 2, 10, 4, 16]
# define labels
labels = ['tom', 'betty', 'alyson', 'john', 'bob']
# create a grid of subplots
fig,axes = plt.subplots(2, 2)
# plot first with just data
pareto(data, axes=axes[0, 0])
plt.title('Basic chart without labels', fontsize=10)
# plot data and associate with labels
pareto(data, labels, axes=axes[0, 1], limit=0.75, line_args=('g',))
plt.title('Data with labels, green cum. line, limit=0.75', fontsize=10)
# plot data and labels, but remove lineplot
pareto(data, labels, cumplot=False, axes=axes[1, 0],
data_kw={'width': 0.5, 'color': 'g'})
plt.title('Data without cum. line, green bar width=0.5', fontsize=10)
# plot data cut off at 95%
pareto(data, labels, limit=0.95, axes=axes[1, 1], limit_kw={'color': 'y'})
plt.title('Data trimmed at 95%, yellow limit line', fontsize=10)
# format the figure and show
fig.canvas.set_window_title('Pareto Plot Test Figure')
plt.show()

Installation
------------

Expand Down

0 comments on commit 729f5bd

Please sign in to comment.