From 3d1eeda8aaf67a0c07e90280a2d9e4ae14ad738a Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Thu, 31 Mar 2016 00:34:17 +0200 Subject: [PATCH] Update the doc to close #24 --- Examples.ipynb | 12 +++++------- README.md | 4 +++- replot/figure.py | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Examples.ipynb b/Examples.ipynb index 2a72d3e..afdf2d4 100644 --- a/Examples.ipynb +++ b/Examples.ipynb @@ -19829,7 +19829,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 43, "metadata": { "collapsed": false }, @@ -20601,7 +20601,7 @@ { "data": { "text/html": [ - "" + "" ], "text/plain": [ "" @@ -20615,16 +20615,14 @@ "# You can invert X and Y components easily\n", "# Note that this will invert axes labels as well\n", "with replot.Figure() as figure:\n", - " x = range(10)\n", - " y = [i**2 for i in x]\n", " figure.xlabel = \"ylabel\"\n", " figure.ylabel = \"xlabel\"\n", - " figure.plot(x, y, invert=True)" + " figure.plot(lambda x: x**2, (0, 10), invert=True) # Note that we plot x^2, not sqrt(x), but invert axis" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 45, "metadata": { "collapsed": false }, @@ -21396,7 +21394,7 @@ { "data": { "text/html": [ - "" + "" ], "text/plain": [ "" diff --git a/README.md b/README.md index 57c7a1a..c072d83 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,9 @@ design in the API, or required feature!
You think loc="top left" is easier to remember than loc="upper left" in a matplotlib.pyplot.legend() call? No worry, this module aliases it for you! (same for "bottom" with - respect to "lower")
+ respect to "lower"). Similarly, you can use xrange or + xlim> arguments to specify axes ranges (respectively + yrange / ylim).
Automatic legend
If any of your plots contains a label keyword, a legend diff --git a/replot/figure.py b/replot/figure.py index 5b6b83a..ba6e20e 100644 --- a/replot/figure.py +++ b/replot/figure.py @@ -268,7 +268,8 @@ class Figure(): such scales. - ``orthonormal`` (boolean) to force axis to be orthonormal. - ``xlim`` and ``ylim`` which are tuples of intervals on the \ - x and y axis. + x and y axis. You can also use the ``xrange`` / \ + ``yrange`` aliases if you find them more convenient. - ``invert`` (boolean) invert X and Y axis on the plot. Invert \ the axes labels as well. - ``rotate`` (angle in degrees) rotate the plot by the angle in \