Created
September 16, 2013 12:44
-
-
Save philippstroehle/6580227 to your computer and use it in GitHub Desktop.
From http://stackoverflow.com/questions/10665163/draw-rectangle-add-patch-in-pylab-mode Plot a rectangle in pylab - matplotlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from pylab import * | |
>>> plot([1,3,2]) | |
[<matplotlib.lines.Line2D object at 0x102bc8950>] | |
>>> gca() | |
<matplotlib.axes.AxesSubplot object at 0x102790cd0> | |
>>> gca().add_patch(Rectangle((1,1),1,1)) | |
<matplotlib.patches.Rectangle object at 0x102790510> | |
>>> savefig("rect.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment