You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
| 2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
| 2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
| 2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
| 2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
| 2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
| 2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
| 2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
| 2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
| 2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
| 2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
| 2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
| 2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
| 2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(20) |
2
(16) |
3
(9) |
4
(12) |
5
(14) |
6
(22) |
|
7
(17) |
8
(33) |
9
(26) |
10
(32) |
11
(47) |
12
(26) |
13
(7) |
|
14
(24) |
15
(44) |
16
(42) |
17
(22) |
18
(31) |
19
(8) |
20
(4) |
|
21
(15) |
22
(27) |
23
(41) |
24
(33) |
25
(31) |
26
(24) |
27
(10) |
|
28
(20) |
|
|
|
|
|
|
|
From: Tim M. <tim...@gm...> - 2010-02-15 14:06:23
|
Hello, I have a similar problem to: > Suppose I plot a line from (0,0) to (1,1.5) to (2,2). Now I want to mark > (1,1.5) with a green circle. How is that done? I am performing a curve fit and also showing a distribution in my plot. In order to help the reader to evaluate the result I would like to draw certain boundaries (vertical and horizontal line). While I am aware on how to draw such lines, I would like to know wheather there are some functions in matplotlib which help me to retrieve the coordinates a) at which two curves intersect b) at which a distribution reaches a certain value? Example: How do I get the y-axis value which is reached by the green curve in http://matplotlib.sourceforge.net/_images/histogram_demo_extended_021.png a x-axis value of in 175? I could proably use a solver from numpy like http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html#numpy.linalg.solve but if I plot a distribution, the equation of the envelove is unknown at the first place. I'd appreciate your help or pointers to examples. Thanks a lot in advance, Timmie |
|
From: Stefaan L. <ste...@gm...> - 2010-02-15 13:27:37
|
http://www.graphviz.org/ ? On Sun, Feb 14, 2010 at 5:35 AM, Mag Gam <mag...@gm...> wrote: > I manage 300 servers at my university lab. I would like to map out all > the cron entries into a nice graph but I am not sure what would be > appropriate. Can someone please suggest what would be ideal? > > TIA > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Michiel de H. <mjl...@ya...> - 2010-02-15 13:17:08
|
I almost have a solution for this for the Mac OS X backend. I am stuck though at what I should pass to enter_notify_event and leave_notify_event for the guiEvent:
def leave_notify_event(self, guiEvent=None):
"""
Backend derived classes should call this function when leaving
canvas
*guiEvent*
the native UI event that generated the mpl event
"""
What are the requirements for guiEvent? If I call leave_notify_event without guiEvent, so guiEvent = None, then the example gives me the following error:
enter_figure Figure(640x480)
leave_figure
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/backend_bases.py", line 1416, in leave_notify_event
self.callbacks.process('figure_leave_event', LocationEvent.lastevent)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/matplotlib/cbook.py", line 169, in process
func(*args, **kwargs)
File "test.py", line 23, in leave_figure
print 'leave_figure', event.canvas.figure
AttributeError: 'NoneType' object has no attribute 'canvas'
So I guess I should pass some type of event object to enter|leave_notify_event.
--Michiel.
--- On Sun, 2/14/10, David Arnold <dwa...@su...> wrote:
> From: David Arnold <dwa...@su...>
> Subject: Re: [Matplotlib-users] Enter Figure on Macs
> To: "John Hunter" <jd...@gm...>
> Cc: "Michiel de Hoon" <mjl...@ya...>, mat...@li...
> Date: Sunday, February 14, 2010, 11:50 PM
> John,
>
> Only the wxagg worked. Here is the output:
>
> $HOME=/Users/darnold
> CONFIGDIR=/Users/darnold/.matplotlib
> matplotlib data path
> /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data
> loaded rc file /Users/darnold/.matplotlib/matplotlibrc
> matplotlib version 0.99.1.1
> verbose.level helpful
> interactive is False
> units is False
> platform is darwin
> Using fontManager instance from
> /Users/darnold/.matplotlib/fontList.cache
> backend WXAgg version 2.8.10.1
> findfont: Matching
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
> to Bitstream Vera Sans
> (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
> with score of 0.000000
> findfont: Matching
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0
> to Bitstream Vera Sans
> (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
> with score of 0.000000
> enter_figure Figure(640x480)
> leave_figure Figure(640x480)
> enter_figure Figure(640x480)
> leave_figure Figure(640x480)
> enter_figure Figure(640x480)
> leave_figure Figure(640x480)
> enter_figure Figure(640x480)
> enter_axes Axes(0.125,0.536364;0.775x0.363636)
> leave_axes Axes(0.125,0.536364;0.775x0.363636)
> enter_axes Axes(0.125,0.1;0.775x0.363636)
> leave_axes Axes(0.125,0.1;0.775x0.363636)
> leave_figure Figure(640x480)
>
>
> Did not work with macosx:
>
> $HOME=/Users/darnold
> CONFIGDIR=/Users/darnold/.matplotlib
> matplotlib data path
> /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data
> loaded rc file /Users/darnold/.matplotlib/matplotlibrc
> matplotlib version 0.99.1.1
> verbose.level helpful
> interactive is False
> units is False
> platform is darwin
> Using fontManager instance from
> /Users/darnold/.matplotlib/fontList.cache
> backend MacOSX version unknown
> enter_axes Axes(0.125,0.536364;0.775x0.363636)
> leave_axes Axes(0.125,0.536364;0.775x0.363636)
> enter_axes Axes(0.125,0.1;0.775x0.363636)
> leave_axes Axes(0.125,0.1;0.775x0.363636)
> enter_axes Axes(0.125,0.1;0.775x0.363636)
> leave_axes Axes(0.125,0.1;0.775x0.363636)
> enter_axes Axes(0.125,0.536364;0.775x0.363636)
> leave_axes Axes(0.125,0.536364;0.775x0.363636)
> enter_axes Axes(0.125,0.1;0.775x0.363636)
> leave_axes Axes(0.125,0.1;0.775x0.363636)
>
>
> Did not work with tkagg:
>
> $HOME=/Users/darnold
> CONFIGDIR=/Users/darnold/.matplotlib
> matplotlib data path
> /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data
> loaded rc file /Users/darnold/.matplotlib/matplotlibrc
> matplotlib version 0.99.1.1
> verbose.level helpful
> interactive is False
> units is False
> platform is darwin
> Using fontManager instance from
> /Users/darnold/.matplotlib/fontList.cache
> backend TkAgg version 8.4
> findfont: Matching
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
> to Bitstream Vera Sans
> (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
> with score of 0.000000
> findfont: Matching
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0
> to Bitstream Vera Sans
> (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
> with score of 0.000000
> enter_axes Axes(0.125,0.536364;0.775x0.363636)
> leave_axes Axes(0.125,0.536364;0.775x0.363636)
> enter_axes Axes(0.125,0.1;0.775x0.363636)
> leave_axes Axes(0.125,0.1;0.775x0.363636)
> enter_axes Axes(0.125,0.536364;0.775x0.363636)
> leave_axes Axes(0.125,0.536364;0.775x0.363636)
> enter_axes Axes(0.125,0.1;0.775x0.363636)
> leave_axes Axes(0.125,0.1;0.775x0.363636)
>
>
>
> On Feb 14, 2010, at 7:50 PM, John Hunter wrote:
>
> > On Sun, Feb 14, 2010 at 6:53 PM, David Arnold <dwa...@su...>
> wrote:
> >> All,
> >>
> >> Any Mac users out there? This script from the User
> Guide does not seem to recognize entering or leaving a
> figure. Any thoughts?
> >
> > My Mac is currently dead, but I developed these events
> while I was a
> > mac user and so am pretty sure they worked. It
> is more likely a
> > specific backend problem than a Mac vs non-Mac problem
> (eg it may be
> > specific to the macosx backend but not a problem for
> macs in general)
> >
> > http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
> >
> > Could you try running the script with the "use"
> directive at the top
> > of your script (before any other mpl code) for
> different backends, eg
> > tkagg vs macosx vs wxagg
> >
> > import matplotlib
> > matplotlib.use('tkagg') # and also try
> macosx and wxagg
> >
> > so we can see exactly where the problem is
> arising. Also, run your
> > script with --verbose-helpful and report the debugging
> output.
> > Looking at the code, it appears the enter_notify_event
> and
> > leave_notify_event are only defined for wx, qt and gtk
> currently, and
> > so need to be implemented for tk and macosx.
> >
> > JDH
>
>
|
|
From: Philipp L. <phi...@tu...> - 2010-02-15 13:11:48
|
On 02/12/2010 07:49 PM, Eric Firing wrote:
> Philipp Lies wrote:
>> Hi,
>>
>> is there a backend that supports 16bit tiff images?
>
> Can you just use png, and use the netpbm utilities or ImageMagick
> convert program to go to and from tiff?
Would be 'dirty' but acceptable if matplotlib would support saving
uncompressed grayscale uint16 png files. But saving nxm uint16 arrays
leads to nxmx3 float arrays which do not even closely resemble my
original data.
Example:
A
array([[47705, 11865, 739, 16941, 37700],
[64321, 26860, 49945, 63556, 13498],
[ 2676, 7720, 5995, 22399, 32735],
[56577, 34443, 6636, 23409, 61331],
[ 1020, 26013, 34677, 37262, 36136]], dtype=uint16)
imsave('t.png',A)
B = imread('t.png')
B[:,:,0]
array([[ 1., 0., 0., 0., 0.74117649],
[ 0.49803922, 0.19607843, 1., 0.5529412 , 0. ],
[ 0., 0., 0., 0., 0.48627451],
[ 1., 0.57647061, 0., 0.01960784, 0.71372551],
[ 0., 0.14509805, 0.58823532, 0.72941178, 0.66666669]],
dtype=float32)
>> According to the website GDK supports tiff but that's wrong:
>>
>> >>>import matplotlib
>> >>>matplotlib.use('GDK')
>> >>>import matplotlib.pyplot as pyplot
>> >>>pyplot.imsave(arr=X, fname='test.tif')
>> Traceback (most recent call last):
>> File "<stdin>", line 1, in <module>
>> File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 1425,
>> in imsave
>> return _imsave(*args, **kwargs)
>> File "/usr/lib/pymodules/python2.6/matplotlib/image.py", line 813, in
>> imsave
>> fig.savefig(fname, dpi=1, format=format)
>> File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 1033,
>> in savefig
>> self.canvas.print_figure(*args, **kwargs)
>> File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
>> 1420, in print_figure
>> '%s.' % (format, ', '.join(formats)))
>> ValueError: Format "tif" is not supported.
>> Supported formats: emf, eps, pdf, png, ps, raw, rgba, svg, svgz.
>> >>>matplotlib.backends.backend
>> 'gdk'
>>
>> matplotlib 0.99.0 python 2.6.4 ubuntu karmic x64
>>
>> If matplotlib cannot provide tiff support, does someone know an
>> alternative? PIL doesn't work either, at least not intuitively.
>>
>> Cheers
>>
>> Philipp
>>
>
--
Philipp Lies
Max Planck Institute for Biological Cybernetics
Computational Vision & Neuroscience Group
Spemannstr. 41
D-72076 Tuebingen
Germany
Phone: +49-7071-601-1788
Fax: +49-7071-601-552
E-Mail: phi...@tu...
http://www.kyb.mpg.de/bethgegroup
|
|
From: John H. <jd...@gm...> - 2010-02-15 13:08:19
|
On Mon, Feb 15, 2010 at 6:50 AM, Michiel de Hoon <mjl...@ya...> wrote:
> I almost have a solution for this for the Mac OS X backend. I am stuck though at what I should pass to enter_notify_event and leave_notify_event for the guiEvent:
>
> def leave_notify_event(self, guiEvent=None):
> """
> Backend derived classes should call this function when leaving
> canvas
>
> *guiEvent*
> the native UI event that generated the mpl event
>
> """
>
> What are the requirements for guiEvent? If I call leave_notify_event without guiEvent, so guiEvent = None, then the example gives me the following error:
we don't make any assumptions about what kind of object the gui event
is. We provide the GUI event because sometimes when using a specific
backend, the user wants to drill into the GUI native event (eg a
button press event) but we don't use it anywhere in the mpl frontend
because this would break the abstraction. So if you have some event
that is being fired at the UI level on figure enter, pass that in.
It looks like you may be having a problem because the
leave_notify_event is getting called more than once, or is called for
a figure that has not been entered. Check the logic in
backend_bases.FigureCanvasBase.leave_notify_event
def leave_notify_event(self, guiEvent=None):
"""
Backend derived classes should call this function when leaving
canvas
*guiEvent*
the native UI event that generated the mpl event
"""
self.callbacks.process('figure_leave_event', LocationEvent.lastevent)
LocationEvent.lastevent = None
It looks like your figure_leave_event is being triggered with
LocationEvent.lastevent = None (so it is not a problem with your
guiEvent). This could happen if a leave event was processed *before*
and enter event (which sets the lastevent), or if a leave event was
processed twice.
Hopefully this will help you drill down into the source of the problem
JDH
|
|
From: Nico S. <nic...@gm...> - 2010-02-15 12:56:25
|
> cb.ax.set_yticklabels((r'$-\pi$', '0', r'$\pi$')) Works like a charm. Thanks! --Nico |
|
From: Nico S. <nic...@gm...> - 2010-02-15 10:06:53
|
Hi, I see that with imsave() it's possible to save an image based on its cmap. Is there also functionality in matplotlib to to store a file based on RGB(alpha) information? Cheers, Nico |
|
From: Jan S. <cur...@gm...> - 2010-02-15 09:51:07
|
Hi Jeff,
thanks for your quick reply.
Unfortunately, the line you sent me doesn't have any effect on the plot,
either before or after turning off the tick labels.
Do you have another suggestion?
Cheers,
Jan
On Sun, Feb 14, 2010 at 11:28 PM, Jeffrey Blackburne <je...@mi...> wrote:
>
> On Feb 14, 2010, at 5:41 PM, Jan Strube wrote:
>
> Dear matplotters,
>>
>> I'm trying to follow
>> http://matplotlib.sourceforge.net/examples/pylab_examples/
>> ganged_plots.html
>> as an example how to turn of the ticks in the case of shared x axes.
>> The tick labels are gone, but unfortunately, matplotlib still plots a
>> '1e5' on the axis for which I have turned off the tick labels.
>> Please see the attached file for the problem
>>
>> How can I also switch of the exponent?
>>
>> Thanks,
>> Jan
>>
>
>
> Try this:
>
> ax.xaxis.set_major_formatter(mpl.ticker.ScalarFormatter(useOffset=False))
>
> where 'ax' is the name of the top subplot.
>
> Good luck,
> Jeff
>
>
|
|
From: Jan S. <jan...@gm...> - 2010-02-15 09:49:39
|
Hi Jeff,
thanks for your quick reply.
Unfortunately, the line you sent me doesn't have any effect on the plot,
either before or after turning off the tick labels.
Do you have another suggestion?
Cheers,
Jan
On Sun, Feb 14, 2010 at 11:28 PM, Jeffrey Blackburne <je...@mi...> wrote:
>
> On Feb 14, 2010, at 5:41 PM, Jan Strube wrote:
>
> Dear matplotters,
>>
>> I'm trying to follow
>> http://matplotlib.sourceforge.net/examples/pylab_examples/
>> ganged_plots.html
>> as an example how to turn of the ticks in the case of shared x axes.
>> The tick labels are gone, but unfortunately, matplotlib still plots a
>> '1e5' on the axis for which I have turned off the tick labels.
>> Please see the attached file for the problem
>>
>> How can I also switch of the exponent?
>>
>> Thanks,
>> Jan
>>
>
>
> Try this:
>
> ax.xaxis.set_major_formatter(mpl.ticker.ScalarFormatter(useOffset=False))
>
> where 'ax' is the name of the top subplot.
>
> Good luck,
> Jeff
>
>
|
|
From: Nico S. <nic...@gm...> - 2010-02-15 08:28:11
|
Hi,
thanks for the suggestion.
> ax.set_xticks((-pi,pi))
> ax.set_xticklabels(('$-\pi$','$\pi$'))
I guess color bars are a little special in the sense that
AttributeError: Colorbar instance has no attribute 'set_yticklabels'
The tick positions are given not by set_yticks either, but as an option
pylab.colorbar(ticks=(-pi,0,pi))
at the instatiation of the bar. It would indeed be very handy if the
bars acted like axes.
Cheers,
Nico
|
|
From: rcnelson <rne...@gm...> - 2010-02-15 07:32:52
|
Most of the plots I need to make for work have very different x and y axis scales, and under these conditions, the pyplot.arrow function (which I think is a FancyArrow) makes arrows where the heads are pretty distorted. (MPL version 0.99.1 -- Windows; version 0.99.1.1-r1 -- Gentoo) I've spent quite a bit of time learning about the different arrow classes -- FancyArrow, YAArrow, FancyArrowPatch -- and I've found that the FancyArrowPatch gives arrows that do not look distorted under these conditions. For examples: import matplotlib.pyplot as plt import matplotlib.patches as mpp fig = plt.figure() ax=fig.add_subplot(111) ax.axis([520,580, 0,0.2]) a = plt.arrow(550,0.06,15,0.1, width=0.01, head_length=1.) ax.add_patch(a) b = mpp.YAArrow(fig, (555,0.16), (540,0.06), width=0.01, headwidth=0.03) ax.add_patch(b) c = mpp.FancyArrowPatch((530,0.06), (545,0.16), arrowstyle='-|>', lw=2, mutation_scale=50) ax.add_patch(c) plt.show() However, this leads to my questions: 1) Are there any plans or would it make sense to add another keyword to the pyplot.arrow function that allows you to choose the arrow class you would like to use? The default could be FancyArrow so that the original usage of pyplot.arrow will not be affected. The axes.arrow function - which it looks like it gets called by the pyplot.arrow function - could then convert the input arguments into the form necessary for the class you choose. 2) Or... Is there a simple way that you can call the arrow function with start and end points in data coordinates, but have the arrow parameters calculated in normalized figure coordinates? I think FancyArrow calculates the head and body points using a line perpendicular to the line of the arrow in data coordinates, which I think is the source of my problem (? -- at least that is what I found doing some test calculations on my own). However, if I call the pyplot.arrow function with the following keywords, 'trasform=fig.transFigure, figure=fig' (as per the Artist tutorial, see below), then the arrow looks okay, but it needs to be positioned in normalized figure coordinates and it does not move when you zoom or translate the plot. d = plt.arrow(0.15, 0.3, 0.15, 0.4, head_width=0.05, transform=fig.transFigure, figure=fig) ax.add_patch(d) For me, this is not a really big concern now that I figured it out, but I'm trying to teach my coworkers how to use Python/Matplotlib, and although they are interested in learning both, most of them are not and probably never will be really strong Python programmers. As a consequence, I think that all of the different arrow options and usages outside of pyplot.arrow will be a bit confusing for them... (I know it was for me at first...) Sorry for the long question message. I hope it was clear. Ryan P.S. As this is my first message to the list, I wanted to thank everyone who contributes to this great project. I'm a fairly new Python and Matplotlib user (only about 7 or 8 months for Python, less for MPL), and the combination of Python/Numpy/Scipy/Matplotlib is by far the most useful tool that I've learned in quite a long time. Hopefully, someday I'll be skilled enough to contribute something back. -- View this message in context: http://old.nabble.com/Arrow-question-request-tp27590334p27590334.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: David A. <dwa...@su...> - 2010-02-15 04:50:51
|
John, Only the wxagg worked. Here is the output: $HOME=/Users/darnold CONFIGDIR=/Users/darnold/.matplotlib matplotlib data path /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data loaded rc file /Users/darnold/.matplotlib/matplotlibrc matplotlib version 0.99.1.1 verbose.level helpful interactive is False units is False platform is darwin Using fontManager instance from /Users/darnold/.matplotlib/fontList.cache backend WXAgg version 2.8.10.1 findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 0.000000 findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to Bitstream Vera Sans (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 0.000000 enter_figure Figure(640x480) leave_figure Figure(640x480) enter_figure Figure(640x480) leave_figure Figure(640x480) enter_figure Figure(640x480) leave_figure Figure(640x480) enter_figure Figure(640x480) enter_axes Axes(0.125,0.536364;0.775x0.363636) leave_axes Axes(0.125,0.536364;0.775x0.363636) enter_axes Axes(0.125,0.1;0.775x0.363636) leave_axes Axes(0.125,0.1;0.775x0.363636) leave_figure Figure(640x480) Did not work with macosx: $HOME=/Users/darnold CONFIGDIR=/Users/darnold/.matplotlib matplotlib data path /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data loaded rc file /Users/darnold/.matplotlib/matplotlibrc matplotlib version 0.99.1.1 verbose.level helpful interactive is False units is False platform is darwin Using fontManager instance from /Users/darnold/.matplotlib/fontList.cache backend MacOSX version unknown enter_axes Axes(0.125,0.536364;0.775x0.363636) leave_axes Axes(0.125,0.536364;0.775x0.363636) enter_axes Axes(0.125,0.1;0.775x0.363636) leave_axes Axes(0.125,0.1;0.775x0.363636) enter_axes Axes(0.125,0.1;0.775x0.363636) leave_axes Axes(0.125,0.1;0.775x0.363636) enter_axes Axes(0.125,0.536364;0.775x0.363636) leave_axes Axes(0.125,0.536364;0.775x0.363636) enter_axes Axes(0.125,0.1;0.775x0.363636) leave_axes Axes(0.125,0.1;0.775x0.363636) Did not work with tkagg: $HOME=/Users/darnold CONFIGDIR=/Users/darnold/.matplotlib matplotlib data path /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data loaded rc file /Users/darnold/.matplotlib/matplotlibrc matplotlib version 0.99.1.1 verbose.level helpful interactive is False units is False platform is darwin Using fontManager instance from /Users/darnold/.matplotlib/fontList.cache backend TkAgg version 8.4 findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium to Bitstream Vera Sans (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 0.000000 findfont: Matching :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0 to Bitstream Vera Sans (/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf) with score of 0.000000 enter_axes Axes(0.125,0.536364;0.775x0.363636) leave_axes Axes(0.125,0.536364;0.775x0.363636) enter_axes Axes(0.125,0.1;0.775x0.363636) leave_axes Axes(0.125,0.1;0.775x0.363636) enter_axes Axes(0.125,0.536364;0.775x0.363636) leave_axes Axes(0.125,0.536364;0.775x0.363636) enter_axes Axes(0.125,0.1;0.775x0.363636) leave_axes Axes(0.125,0.1;0.775x0.363636) On Feb 14, 2010, at 7:50 PM, John Hunter wrote: > On Sun, Feb 14, 2010 at 6:53 PM, David Arnold <dwa...@su...> wrote: >> All, >> >> Any Mac users out there? This script from the User Guide does not seem to recognize entering or leaving a figure. Any thoughts? > > My Mac is currently dead, but I developed these events while I was a > mac user and so am pretty sure they worked. It is more likely a > specific backend problem than a Mac vs non-Mac problem (eg it may be > specific to the macosx backend but not a problem for macs in general) > > http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend > > Could you try running the script with the "use" directive at the top > of your script (before any other mpl code) for different backends, eg > tkagg vs macosx vs wxagg > > import matplotlib > matplotlib.use('tkagg') # and also try macosx and wxagg > > so we can see exactly where the problem is arising. Also, run your > script with --verbose-helpful and report the debugging output. > Looking at the code, it appears the enter_notify_event and > leave_notify_event are only defined for wx, qt and gtk currently, and > so need to be implemented for tk and macosx. > > JDH |
|
From: David A. <dwa...@su...> - 2010-02-15 04:36:52
|
All, This example: http://matplotlib.sourceforge.net/examples/event_handling/keypress_demo.html Raises this exception o my Macbook when the key 's' is pressed: The debugged program raised the exception unhandled TypeError "save_figure() takes exactly 1 argument (2 given)" File: /Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/backend_bases.py, Line: 1703 David |
|
From: John H. <jd...@gm...> - 2010-02-15 03:50:20
|
On Sun, Feb 14, 2010 at 6:53 PM, David Arnold <dwa...@su...> wrote: > All, > > Any Mac users out there? This script from the User Guide does not seem to recognize entering or leaving a figure. Any thoughts? My Mac is currently dead, but I developed these events while I was a mac user and so am pretty sure they worked. It is more likely a specific backend problem than a Mac vs non-Mac problem (eg it may be specific to the macosx backend but not a problem for macs in general) http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend Could you try running the script with the "use" directive at the top of your script (before any other mpl code) for different backends, eg tkagg vs macosx vs wxagg import matplotlib matplotlib.use('tkagg') # and also try macosx and wxagg so we can see exactly where the problem is arising. Also, run your script with --verbose-helpful and report the debugging output. Looking at the code, it appears the enter_notify_event and leave_notify_event are only defined for wx, qt and gtk currently, and so need to be implemented for tk and macosx. JDH |
|
From: John H. <jd...@gm...> - 2010-02-15 03:38:49
|
On Sat, Feb 13, 2010 at 2:53 PM, John Jameson <jja...@al...> wrote: > HI, > I find the very basic animation below has a memory leak (my pagefile usage > number keeps growing in the Windows XP Windows Task Manager Performance > graph).I don't see this with the "animation_blit_gtk.py" example on: > > http://matplotlib.sourceforge.net/examples/index.html > > (which I used as a starting point for this). In "animation_blit_gtk.py" the > set_ydata() routine is used to update the line for the animation and this > does not leak. But if you call plot again with the new y_data (instead of > using set_ydata), this leaks too. Anyone have an idea on how to stop the > leak? This isn't a memory leak. The problem is that you keep adding new patches to the axes when you want just one with different data. Eg, in your loop, run this code, and you will see that the number of patches is growing: x_cir = 1.0 + 0.003*update_line.cnt cir = CirclePolygon((x_cir, 1), 0.3, animated=True, \ resolution=12, lw=2 ) ax.add_patch(cir) ax.draw_artist(cir) print 'num patches=%d, mem usage=%d'%( len(ax.patches), cbook.report_memory(update_line.cnt)) canvas.blit(ax.bbox) You should add just one patch and then manipulate the data. In this case, you are using a CirclePolygon which derives from RegularPolygon and so you can update the "xy" property http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.RegularPolygon But on testing this it looks like there is a bug in that the set_xy property setter is ignored. I worked around this in the func below by setting the private variable directly, but this looks like a bug we need to fix (Michael, shouldn't we respect the xy passed in in patches.RegularPolygon._set_xy ?). In the meantime, the following workaround should work for you w/o leaking.... def update_line(): global x, y print update_line.cnt if update_line.background is None: update_line.background = canvas.copy_from_bbox(ax.bbox) canvas.restore_region(update_line.background) x_cir = 1.0 + 0.003*update_line.cnt if update_line.cir is None: cir = CirclePolygon((x_cir, 1), 0.3, animated=True, \ resolution=12, lw=2 ) ax.add_patch(cir) update_line.cir = cir else: update_line.cir._xy = x_cir, 1 update_line.cir._update_transform() ax.draw_artist(update_line.cir) print 'num patches=%d, xy=%s, mem usage=%d'%( len(ax.patches), update_line.cir.xy, cbook.report_memory(update_line.cnt)) canvas.blit(ax.bbox) if update_line.direction == 0: update_line.cnt += 1 if update_line.cnt > 500: update_line.direction = 1 else: update_line.cnt -= 1 if update_line.cnt < 100: update_line.direction = 0 return update_line.cnt<100 update_line.cnt = 0 update_line.direction = 0 update_line.background = None update_line.cir = None |
|
From: David A. <dwa...@su...> - 2010-02-15 02:37:36
|
All,
Any Mac users out there? This script from the User Guide does not seem to recognize entering or leaving a figure. Any thoughts?
# enterleave.py
import matplotlib.pyplot as plt
def enter_axes(event):
print 'enter_axes', event.inaxes
event.inaxes.patch.set_facecolor('yellow')
event.canvas.draw()
def leave_axes(event):
print 'leave_axes', event.inaxes
event.inaxes.patch.set_facecolor('white')
event.canvas.draw()
def enter_figure(event):
print 'enter_figure', event.canvas.figure
event.canvas.figure.patch.set_facecolor('red')
event.canvas.draw()
def leave_figure(event):
print 'leave_figure', event.canvas.figure
event.canvas.figure.patch.set_facecolor('grey')
event.canvas.draw()
fig1 = plt.figure()
fig1.suptitle('mouse hover over figure or axes to trigger events')
ax1 = fig1.add_subplot(211)
ax2 = fig1.add_subplot(212)
fig1.canvas.mpl_connect('figure_enter_event', enter_figure)
fig1.canvas.mpl_connect('figure_leave_event', leave_figure)
fig1.canvas.mpl_connect('axes_enter_event', enter_axes)
fig1.canvas.mpl_connect('axes_leave_event', leave_axes)
fig2 = plt.figure()
fig2.suptitle('mouse hover over figure or axes to trigger events')
ax1 = fig2.add_subplot(211)
ax2 = fig2.add_subplot(212)
fig2.canvas.mpl_connect('figure_enter_event', enter_figure)
fig2.canvas.mpl_connect('figure_leave_event', leave_figure)
fig2.canvas.mpl_connect('axes_enter_event', enter_axes)
fig2.canvas.mpl_connect('axes_leave_event', leave_axes)
plt.show()
David
|
|
From: Jae-Joon L. <lee...@gm...> - 2010-02-15 02:07:03
|
I have added a bbox support for "restore_region", but I'm afraid that
this feature is not well tested. And I guess what you find is,
unfortunately, a bug. While I'll try to push the changes to the svn
tomorrow, you may try to monkey-patch with following code.
from matplotlib.transforms import Bbox, BboxBase
from matplotlib.backends.backend_agg import RendererAgg
def restore_region(self, region, bbox=None, xy=None):
if bbox is not None or xy is not None:
rx, ry, width, height = region.get_extents()
if bbox is None:
x1, y1, x2, y2 = region.get_extents()
elif isinstance(bbox, BboxBase):
x1, y1, x2, y2 = bbox.extents
else:
x1, y1, x2, y2 = bbox
if xy is None:
ox, oy = rx, ry
else:
ox, oy = xy
self._renderer.restore_region2(region, x1, height-y2+ry, x2,
height-y1+ry,
ox, oy)
else:
self._renderer.restore_region(region)
RendererAgg.restore_region = restore_region
But, again, the code is not well tested and there could be another bug
(or even this patch may introduce a new bug). So, see how it works and
let know of any problem.
However, while matplotlib does support some animation, I think you 'd
better turn to another tool if you need an efficiency,
Regards,
-JJ
On Sun, Feb 14, 2010 at 2:18 PM, Brendan Barnwell <bre...@br...> wrote:
> Brendan Barnwell wrote:
>> I'm trying to find the quickest way to erase a rectangular area of
>> the figure canvas. I tried using canvas.restore_region with the
>> optional bbox argument, but there seems to be some mismatch between
>> the measurement units of the saved buffer object and the currently
>> shown data. For instance, if I have a Text object on my plot, I tried
>> this:
>>
>> bbox = g.text.get_window_extent()
>> canvas.restore_region(background, bbox)
>>
>> . . . but it does not correctly block out the text. (The restored
>> rectangle from the background appears elsewhere on the axes.) How can
>> I convert the buffer coordinates to the coordinates of the the
>> displayed plot?
>
> I'm sorry to bump my own post, but I would really appreciate some
> help with this. I've been wrestling with it for a couple days now,
> and I cannot figure out how the coordinate system of the saved canvas
> is related to the axes coordinates. I have found that with
> bbox.transformed(ax.transData) I can at least get the coordinates
> scaled to fit on the axes, but they are still offset in position from
> where the box actually appears on the canvas. I can't figure out how
> to compute this offset.
>
> By playing around with the coordinates manually, for instance, I've
> found that adjusting x by -52 and y by 21 appears to line up the
> canvas with the axes, but I can't see where these numbers -52 and 21
> would come from. My saved canvas buffer's get_extents() method
> returns (65, 50, 586, 443), so I thought that the appropriate offsets
> would be 65 and 50, but that doesn't work.
>
> So, what coordinates (x1, y1, x2, y2) do I need to use in
> canvas.restore_region(savedBuffer, (x1, y1, x2, y2)) in order to
> restore precisely the area of canvas occupied by a patch drawn at axis
> coordinates (a1, b1, a2, b2)?
>
> Thanks?
> --
> Brendan Barnwell
> "Do not follow where the path may lead. Go, instead, where there is
> no path, and leave a trail."
> --author unknown
>
> ------------------------------------------------------------------------------
> SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
> Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
> http://p.sf.net/sfu/solaris-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|