maser rati | 1 Feb 02:22
Picon
Favicon

Question about the Matplotlib classic Toolbar - the pan feature to display only existent data..

Hi folks,

reposting... has anyone a clue that might help in the right direction??

was my question too hard or would it help better if I rephrased it ?

thanks so much

maser


maser rati <maseriyer-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:
Hi Folks,

I was wondering how to set the Matplotlib classic Toolbar in order to display only existent data when the back/forward arrows are clicked (i.e, the pan feature) for a subplot that displays plotted data.

How to set the code in the matplotlib toolbar to only display the data from the file? ( clicking the left arrow when the left most point is at the start of the data file should result in freezing of the plot and a similar action when the right arrow is clicked when the right most point is at the end of the data file).

I'm not sure if my post was sufficiently as clear as spring water. Any suggestions would be greatly appreciated.

Great forum, by the way..

Thanks.
-Maser
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
Matplotlib-users mailing list
Matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Access over 1 million songs - Yahoo! Music Unlimited.-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV_______________________________________________
Matplotlib-users mailing list
Matplotlib-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Derek Hohls | 1 Feb 13:17
Picon

Re: windrose 0.5

Lionel

I have encountered a problem with windrose.  In some cases, one or more
of the
wind direction values are null [''] - the program then fails on line
200:
   values = select( [greater_equal( direction, wind_classes[i]
)],[speed], default=-1.e20 )
Is it possible for you to upgrade the program to perform error
trapping
and simply skip (i.e. not process) any values that are null (and handle
the
exceptional case that all of them might, in fact, be null).

Thanks!
Derek

>>> Lionel Roubeyrie <lroubeyrie@...> 2006/10/18 05:57:55 PM
>>>

Hi Derek,
happy to see you use it, here is windrose0.5 with some improvments :-)

> * do not outline the colors in black; its hard to see
smaller/shorter
> lines
Done

> * the % labels need either to go along a vector NOT used to draw
data,
> or
> be drawn last (on top of data); or a combination of both
Now "%" is set with the external label. I don't find how to set labels
(and 
grids) above patches, ax.set_axisbelow(False) doesn't work :-( But for
the 
moment you can use labangle parameter to move the labels.

> * the 0.0% label can probably be omitted from the centre
> * drawing a title("") on the plot is still problematic (it
overwrites
> the "N" in some cases)
0.0 is not longer draw

> * default background color should be white
Hum, everybody can set it directly from matplotlibrc or creating an
polar axis 
before.

> * a legend title will *very* useful
Waiting for polar axes legend improvments :-)

>
> And a question - is it possible to restrict the plot to a portion of
> the area;
> say to the left, with a "rectangle" of the space available to the
> right; or
> up to the top, with a "rectangle" of the space available to the
> bottom.
> Plots often have to annotated and its useful to have some working
> space
> to do this.
Don't know if I really understand what you want, but why don't you use
subplot 
to split your figures?
>
> Thanks for all the good work!
> Derek

>PS Does anyone else using this program get the strange "[" and "]"
>signs around the data ranges in the legend - how can this be turned
off?
You're the first saying you use it :-)
Maybe differents progs versions. I use:
|datas|[42]>matplotlib.__version__
   Out [42]:'0.87.5'
|datas|[43]>scipy.__version__
   Out [43]:'0.5.1'
|datas|[44]>numpy.__version__
   Out [44]:'1.0b5'

Lionel

-- 
Lionel Roubeyrie - lroubeyrie@... 
LIMAIR
http://www.limair.asso.fr 

-- 
This message is subject to the CSIR's copyright, terms and conditions and
e-mail legal notice. Views expressed herein do not necessarily represent the
views of the CSIR.

CSIR E-mail Legal Notice
http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html 

CSIR Copyright, Terms and Conditions
http://mail.csir.co.za/CSIR_Copyright.html 

For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR
Legal Notice send a blank message with REQUEST LEGAL in the subject line to
CallCentre@...

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Lionel Roubeyrie | 1 Feb 13:34
Picon
Favicon

Re: windrose 0.5

Hi Derek,
I forgot to mention: you can pass throught your problem by using a masked 
array instead of a simple array, and it should work fine, the 'default' 
parameter is here to fill missing value by -1.e20, then these directions will 
be dropped if your speed_classes not include that missing value (generally we 
compute on positives speeds).

Le Jeudi 01 Février 2007 13:17, Derek Hohls a écrit :
> Lionel
>
> I have encountered a problem with windrose.  In some cases, one or more
> of the
> wind direction values are null [''] - the program then fails on line
> 200:
>    values = select( [greater_equal( direction, wind_classes[i]
> )],[speed], default=-1.e20 )
> Is it possible for you to upgrade the program to perform error
> trapping
> and simply skip (i.e. not process) any values that are null (and handle
> the
> exceptional case that all of them might, in fact, be null).
>
> Thanks!
> Derek

--

-- 
Lionel Roubeyrie - lroubeyrie@...
LIMAIR
http://www.limair.asso.fr

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Claas Teichmann | 1 Feb 15:51
Picon

Wrong colorbar-ticks in imshow-colorbar with 10 colors

Hi all,

I want to use imshow to plot an array of floats using interpolation='nearest' so that every gridbox has a distinct color. Also I want to limit the number of colors to a rather small number, e.g. 10. The problem is that the tick labels are not at the edge of each color in the colorbar, but somewhere in between.

An example is the trunk/matplotlib/examples/poormans_contour.py which does not work in my case.

from pylab import *


delta = 0.01
x = arange(-3.0, 3.0, delta)
y = arange(-3.0, 3.0, delta)
X,Y = meshgrid(x, y)
Z1 = bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
Z = Z2 - Z1 # difference of Gaussians

cmap = cm.get_cmap('jet', 10)    # 10 discrete colors

im = imshow(Z, cmap=cmap, interpolation='bilinear')
axis('off')
colorbar()
#savefig('test')
show()

Is there a solution?


Ciao Claas

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Joel Hedlund | 1 Feb 17:09

Bug: Image transparency varies periodically for imshow(img, aspect='auto') at high magnification

Hi!

I believe I've found a bug in matplotlib which manifests after 
imshow(img, aspect='auto') when only a small portion of the image is 
displayed, e.g: when (xmax-xmin) << img.shape[1]. The effect of the bug 
is that the transparency for the entire image seems to vary, seemingly 
as a periodic funtion of (xmax-xmin). Explicitly setting the alpha 
channel for each pixel has no effect.

The attached script generates a random image of a certain size, and 
plots it in four different subplots. The only thing that differs between 
the subplots are slight variations in x_max. The four subplots are labeled:

1) The background image is visible.
2) The background image is not visible!
3) The background image is faded!
4) The background image is again visible!

which reflects the actual result on my system. As the subplots are 
scaled (for example by resizing the window), the intensity then varies 
in a periodic manner in each of the subplots.

The expected result is of course that the background should be fully 
visible in all subplots.

Additional details:

$ python test.py --verbose-helpful
matplotlib data path /usr/lib/python2.4/site-packages/matplotlib/mpl-data
$HOME=/home/bioinfo/yohell
CONFIGDIR=/home/bioinfo/yohell/.matplotlib
loaded rc file 
/usr/lib/python2.4/site-packages/matplotlib/mpl-data/matplotlibrc
matplotlib version 0.87.7
verbose.level helpful
interactive is False
platform is linux2
numerix numpy 1.0
font search path ['/usr/lib/python2.4/site-packages/matplotlib/mpl-data']
loaded ttfcache file /home/bioinfo/yohell/.matplotlib/ttffont.cache
backend WXAgg version 2.6.1.2pre

In this example I used the WXAgg backend, but GTKAgg shows the same 
results. I've also reproduced this bug on a WinXP machine.

Thanks for an excellent plotting package!
/Joel Hedlund
Linköping University
Attachment (test.py): text/x-python, 691 bytes
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Darren Dale | 1 Feb 17:50

Re: Bug: Image transparency varies periodically for imshow(img, aspect='auto') at high magnification

Hi Joel,

On Thursday 01 February 2007 11:09:11 am Joel Hedlund wrote:
> I believe I've found a bug in matplotlib which manifests after
> imshow(img, aspect='auto') when only a small portion of the image is
> displayed, e.g: when (xmax-xmin) << img.shape[1]. The effect of the bug
> is that the transparency for the entire image seems to vary, seemingly
> as a periodic funtion of (xmax-xmin). Explicitly setting the alpha
> channel for each pixel has no effect.
>
> The attached script generates a random image of a certain size, and
> plots it in four different subplots. The only thing that differs between
> the subplots are slight variations in x_max. The four subplots are labeled:
>
> 1) The background image is visible.
> 2) The background image is not visible!
> 3) The background image is faded!
> 4) The background image is again visible!
>
> which reflects the actual result on my system. As the subplots are
> scaled (for example by resizing the window), the intensity then varies
> in a periodic manner in each of the subplots.
>
> The expected result is of course that the background should be fully
> visible in all subplots.

I can verify this behavior, more or less. I observe that the figure.dpi rc 
setting influences the results (I tried 86.23 and 200).

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Daniel Wheeler | 1 Feb 20:04
Favicon

imshow(), set_data() and sequential update problem with two figures

Hi,

I am having some difficulties understanding the following matplotlib behavior.
The script below draws two plots and then updates each one with new data. The
imshow() command is used to set the initial data. The data is then updated with
the set_data() method of the return object from imshow(). The second plot
works fine, however, the first plot does not update itself after the set_data() command
and subsequent draw() command. I am baffled as to the reason for this and was wondering
what the correct behavior should be.

I am using matplotlib version '0.87.7', numpy version '1.0' and python version '2.4.2'.

Cheers

The script.


import pylab, numpy

pylab.ion()

## make figure 0, works fine

fig0 = pylab.figure()
pylab.title('data0')
image0 = pylab.imshow(numpy.zeros((2,2), 'd'))
pylab.colorbar()
pylab.draw()
raw_input('fig 0')

## make figure 1, works fine

fig1 = pylab.figure()
pylab.title('data1')
image1 = pylab.imshow(numpy.zeros((2,2), 'd'))
pylab.colorbar()
pylab.draw()
raw_input('fig 1')

## redraw figure 0 with new data, this figure does not update itself

newdata = numpy.array(((0.,1.),(2.,3.)))
pylab.figure(fig0.number)
image0.set_data(newdata)
pylab.clim(vmax=3, vmin=0)
pylab.draw()
raw_input('fig 0')

## redraw figure 1 with new data, works fine

pylab.figure(fig1.number)
image1.set_data(newdata)
pylab.clim(vmax=3, vmin=0)
pylab.draw()
raw_input('fig 1')


--

Daniel Wheeler



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Eric Firing | 1 Feb 20:36

Re: Bug: Image transparency varies periodically for imshow(img, aspect='auto') at high magnification

Darren Dale wrote:
> Hi Joel,
> 
> On Thursday 01 February 2007 11:09:11 am Joel Hedlund wrote:
>> I believe I've found a bug in matplotlib which manifests after
>> imshow(img, aspect='auto') when only a small portion of the image is
>> displayed, e.g: when (xmax-xmin) << img.shape[1]. The effect of the bug
>> is that the transparency for the entire image seems to vary, seemingly
>> as a periodic funtion of (xmax-xmin). Explicitly setting the alpha
>> channel for each pixel has no effect.
>>
>> The attached script generates a random image of a certain size, and
>> plots it in four different subplots. The only thing that differs between
>> the subplots are slight variations in x_max. The four subplots are labeled:
>>
>> 1) The background image is visible.
>> 2) The background image is not visible!
>> 3) The background image is faded!
>> 4) The background image is again visible!
>>
>> which reflects the actual result on my system. As the subplots are
>> scaled (for example by resizing the window), the intensity then varies
>> in a periodic manner in each of the subplots.
>>
>> The expected result is of course that the background should be fully
>> visible in all subplots.
> 
> I can verify this behavior, more or less. I observe that the figure.dpi rc 
> setting influences the results (I tried 86.23 and 200).

This sounds like the same bug that was noted a few months ago, in which 
  repeated zooming to a very small part of the image ends up washing out 
the color entirely.  I think that it was also connected with very slow 
rendering.

Eric

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Joel Hedlund | 1 Feb 23:09

Re: Bug: Image transparency varies periodically for imshow(img, aspect='auto') at high magnification

> I think that it was also connected with very slow rendering.

I second that. Rendering is very slow when this occurs.

A workaround is to slice the image and just plot the visible pixels, and
then to use the 'extent' keyword argument to position the slice on the
axis, e.g:

imagesc(img[a:b,ymin:ymax,:], extent=(a,b,ymin,ymax), aspect='auto')

/Joel

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Picon

Re: freezing matplotlib

Le lundi 25 décembre 2006 16:00, Allan Noriel Estrella a écrit :
> Has anyone tried freezing matplotlib embedded in a wx app (using py2ece,
> cx_freeze or pyinstaller)? The setup.py in the FAQ seems to be outdated. I
> want to freeze the embedding_in_wx.py in the examples. Do you have any
> suggestions or cookbook steps that I can follow?

it looks there were no answer to your question!

I tried too the FAQ 
http://matplotlib.sourceforge.net/faq.html#PY2EXE

and it does not work at least with my enthough installation directories seems 
to be very different from the one suggested.

I also tried http://www.py2exe.org/index.cgi/MatPlotLib without success

I tried the simpelst thing 

from pylab import *
plot([1,2,3])
show()

no chance!
I don't know if someone could help, is there a better backend for freezing, 
maybe wxpython?

Someone already succeded with a recent matplotlib ?
I'm using 0.87.3 (on windows)

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Gmane