From 7db44474e90e160d0aa880d2709938cc7a60b6e2 Mon Sep 17 00:00:00 2001 From: Yi-Xin Liu Date: Tue, 9 Sep 2014 17:42:28 -0700 Subject: [PATCH] Fix a serious error in README. --- CHANGELOG.rst | 10 ++++++++++ README.rst | 18 ++++++++++-------- mpltex/_version.py | 2 +- tests/test_plot.py | 2 +- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 91c033a..14cd0c4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,16 @@ mpltex Changelog Here you can see the full list of changes between each ``pltex`` release. +Version 0.2.3 +------------- + +* Fix an serious error in the sample code in README. + +Version 0.2.2 +------------- + +* The same as v0.2.1. + Version 0.2.1 ------------- diff --git a/README.rst b/README.rst index 1d2c5c6..c450e7f 100644 --- a/README.rst +++ b/README.rst @@ -30,7 +30,9 @@ Quickstart 2. Usage ^^^^^^^^ -Just add one of ``mpltex`` decorators before your plot functions. +Examples and sample plots can be found `here `_. + +Following is a breif introduction. Just add one of ``mpltex`` decorators before your plot functions. .. code:: python @@ -47,7 +49,7 @@ Just add one of ``mpltex`` decorators before your plot functions. # Then use your_plot in a normal way. your_plot() -And it will produce images suitable for publishing in American Chemical Society (ACS). +And it will create a plot ready for publishing in journals published by American Chemical Society (ACS). ``mpltex`` also contains several helper functions to faciliate production of specific type of images. Following codes will produce a set of line arts with cycled line styles and line markers with the help of ``mpltex.linestyle_generator`` function. @@ -59,12 +61,14 @@ Following codes will produce a set of line arts with cycled line styles and line @mpltex.acs_decorator def your_plot(): - # generate data x and y + # ... # generate data x and y fig, ax = plt.subplots(111) + + # The default line style is iterating over + # color, line, and marker with hollow types. + linestyles = mpltex.linestyle_generator() + for i in range(number_of_lines): - # The default line style is iterating over - # color, line, and marker with hollow types. - linestyles = mpltex.linestyle_generator() ax.plot(x[i], y[i], label=str(i), **linestyles.next()) ax.locator_params(nbins=5) # limit the number of major ticks @@ -78,8 +82,6 @@ Following codes will produce a set of line arts with cycled line styles and line * ``mpltex.presentation_decorator``: output PDF images for presentation slides (Keynote). * ``mpltex.web_decorator``: output PNG images for web pages. -Examples and sample plots can be found `here `_. - Contribute ---------- diff --git a/mpltex/_version.py b/mpltex/_version.py index 8bd0944..add5b23 100644 --- a/mpltex/_version.py +++ b/mpltex/_version.py @@ -6,5 +6,5 @@ Version info for ``mpltex`` package. """ -__version__ = "0.2.1" +__version__ = "0.2.3" diff --git a/tests/test_plot.py b/tests/test_plot.py index 15e1b6b..376b3ae 100644 --- a/tests/test_plot.py +++ b/tests/test_plot.py @@ -49,8 +49,8 @@ def test_plot_scatter(): y = np.random.normal(size=10).cumsum() x = np.arange(10) ax.plot(x, y, label=str(i), **linestyle.next()) - ax.locator_params(nbins=5) + ax.locator_params(nbins=5) ax.set_xlabel('Number of steps') ax.set_ylabel('Distance') ax.legend(loc='best', ncol=4)