[Matplotlib-users] Two Scales - twinx()

2014-02-23 Thread Stephen George
Hi,

I was wanting to use dual scales on my plot and was just running the example 
code from

http://matplotlib.org/examples/api/fahrenheit_celsius_scales.html

I subsequently changed the function Tc to read

def  Tc(Tf):

 return Tf

Fully expecting the two scales to track each other perfectly.

I found after zooming the scales did not track each other.

So my question is:

Am I misunderstanding what my change should have done, or is there some error 
in the example code?

I tried this on win7 64 with:

python 2.7

numpy 1.8.0

matplotlib 1.3.1

Any suggestion welcome.

Thanks

Steve






--
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib-0.98.5.3.win32-py2.6.exe

2009-07-01 Thread Stephen George
Hi,

I just downloaded matplotlib-0.98.5.3.win32-py2.6.exe from sourceforge.

I have an existing Application that works fine with
python   : 2.5.4 final 0
pyGTK: 2.12.1
GTK+ : 2.14.7
numpy: 1.2.1
matplotlib   : 0.98.5.2


Now I am trying the same App on
python version: 2.6.0 final 0
pyGTK version : 2.12.1
gtk+ version  : 2.16.2
numpy version : 1.3.0
matplotlib version: 0.98.5.3

I got the following traceback, I'm wondering:
 - Am I looking at changes due to the different matplotlib versions?
- Are some bits are missing in the downloaded installer ?
 - or is there incompatibility with the newer versions of GTK?

importing matplotlib
Traceback (most recent call last):
  File "C:\SVNproj\FrictionTests2\PyGTKFricPlot.py", line 17, in 
from matplotlib.backends.backend_gtk import FigureCanvasGTK as 
FigureCanvas
  File 
"C:\Python26\Lib\site-packages\matplotlib\backends\backend_gtk.py", line 
25, in 
from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
  File 
"C:\Python26\Lib\site-packages\matplotlib\backends\backend_gdk.py", line 
29, in 
from matplotlib.backends._backend_gdk import pixbuf_get_pixels_array
ImportError: No module named _backend_gdk

Thanks for any clues
Steve

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib-0.98.5.3.win32-py2.6.exe

2009-07-13 Thread Stephen George
Hi Christoph,

Sorry for my delay to get back to you.

The svn version seems to work fine with GTK support, at least my 
application had no problems running

The versions I tested with are as follows:
python version: 2.6.0 final 0
numpy version: 1.3.0
matplotlib version: 0.98.6svn
gtk+ version: 2.16.2
pyGTK version: 2.12.1

Thank you
you have been a big help

Steve

Christoph Gohlke wrote:
> Hi Steve,
>
> matplotlib-0.98.5.3.win32-py2.6.exe was compiled without support for GTK.
>
> If you don't mind trying, I have a build of the matplotlib trunk 
> available on my homepage that has GTK support enabled:
>
> http://www.lfd.uci.edu/~gohlke/#pythonlibs
>
> It should work with the PyGTK 2.12 Windows binaries from 
> http://www.pygtk.org/downloads.html.
>
> SVG support seems broken: the window.set_icon_from_file() function in 
> backend_gtk.py will raise an exception, not recognizing SVG files. The 
> PNG icon works.
>
> Christoph
>
> --
> Enter the BlackBerry Developer Challenge  
> This is your chance to win up to $100,000 in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have 
> the opportunity to enter the BlackBerry Developer Challenge. See full prize 
> details at: http://p.sf.net/sfu/blackberry
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>   


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib-0.98.5.3.win32-py2.6.exe (Stephen George)

2009-07-14 Thread Stephen George
Hi Jon,

To clarify, I think you need to read Christoph Gohlke original message 
(7/7/2009) to me to put my response into context:
> Hi Steve,
>
> matplotlib-0.98.5.3.win32-py2.6.exe was compiled without support for GTK.
>
> If you don't mind trying, I have a build of the matplotlib trunk 
> available on my homepage that has GTK support enabled:
>
> http://www.lfd.uci.edu/~gohlke/#pythonlibs
>
> It should work with the PyGTK 2.12 Windows binaries from 
> http://www.pygtk.org/downloads.html.
>
> SVG support seems broken: the window.set_icon_from_file() function in 
> backend_gtk.py will raise an exception, not recognizing SVG files. The 
> PNG icon works.
>
> Christoph
>   

 From that web page I downloaded 
http://www.lfd.uci.edu/~gohlke/download/matplotlib-0.98.6svn.win32-py2.6.exe
NOTICE the version number 0.98.6svn

Then in my code I have the following lines:

from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
from matplotlib.backends.backend_gtk import NavigationToolbar2GTK as 
NavigationToolbar

For your benefit I changed to the same backend as yours ( GTKAgg backend 
) and run again

My application ran successfully with both the GTKAgg and GTKCario backends.
Why don't you take the svn version for a spin, you might also have success.

Hope this has been of some help
Steve


Jon Roadley-Battin wrote:
> Question is however, are you using the GTK backend?
> ie
>
> from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as 
> FigureCanvas
> from matplotlib.backends.backend_gtkagg import 
> NavigationToolbar2GTKAgg as NavigationToolbar
>
> backend_gtkagg then imports matplotlib.backends._gtkagg
> For matplotlib-0.98.5.2.win32-py2.5.exe
> C:\Python25\Lib\site-packages\matplotlib\backends\_gtkagg.pyd  exists
>
> For matplotlib-0.98.5.3.win32-py2.6.exe
> C:\Python26\Lib\site-packages\matplotlib\backends\_gtkagg.pyd doesn't
>
> ie gtk backend doesn't seem to be compiled.
> matplotlib is the only thing holding me back in moving to python26 (on 
> windows). Hopefully the svn build is updated soon or a new release is 
> due soon (I can wait )
>  
>
> >Hi Christoph,
> >
> >Sorry for my delay to get back to you.
> >
> >The svn version seems to work fine with GTK support, at least my
> >application had no problems running
> >
> >The versions I tested with are as follows:
> >  python version: 2.6.0 final 0
> >   numpy version: 1.3.0
>
> >  matplotlib version: 0.98.6svn
> >   gtk+ version: 2.16.2
> >   pyGTK version: 2.12.1
> >
> >Thank you
> >you have been a big help
>
> >Steve
>
>
> 
>
> --
> Enter the BlackBerry Developer Challenge  
> This is your chance to win up to $100,000 in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize  
> details at: http://p.sf.net/sfu/Challenge
> 
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   


--
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] gtkagg backend - update behavior question

2009-11-27 Thread Stephen George
Hi Alastair,

I don't have  clue why yours doesn't work.

however I changed the following line in the update function
data[20]=data[20]+0.5

to
data = np.random.randn(100)

And it started updating the display, with new data each update.
maybe changing a single point is not seen as a big enough change?

Steve

Alastair McKinley wrote:
> Hi everyone,
>
> I am a new matplotlib user building a simple visualization tool.
>
> I was having some issues with the graph not redrawing and I think I 
> have reduced it to a minimal case that doesn't work as expected for me.
>
> In the example below one of the data elements is changed on every 
> iteration of the update function, but the graph does not update as 
> expected.
>
> Am I making a mistake in my usage?
>
> Alastair
>
>
>
> #!/usr/bin/env python
>
> import gtk
> import gobject
> from matplotlib.figure import Figure
> import numpy as np
>
> from matplotlib.backends.backend_
> gtkagg import FigureCanvasGTKAgg as FigureCanvas
>
> def update(line):
> global data
> data[20]=data[20]+0.5
> line.set_ydata(data)
> line.axes.figure.canvas.draw()
> return True
>
> win = gtk.Window()
> win.connect("destroy", lambda x: x.destroy())
> win.set_default_size(400,300)
> fig = Figure(figsize=(5,4), dpi=100)
> ax = fig.add_subplot(111)
> canvas = FigureCanvas(fig)
> win.add(canvas)
>
> data = np.random.randn(100)
> line, = ax.plot(data)
>
> win.show_all()
>
> gobject.timeout_add(1000,update,line)
>
> gtk.main()
> 


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to control display precision and style (e.g., %f or %e) of axis tick labels?

2010-02-23 Thread Stephen George
David Goldsmith wrote:
> I've searched and searched the online docs...please help.
>
> DG
>   
If I understand your question correctly you probably need to look at
http://matplotlib.sourceforge.net/api/ticker_api.html#tick-formatting

ax.xaxis.set_major_formatter( xmajorFormatter )
ax.xaxis.set_minor_formatter( xminorFormatter )
 


- Steve

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] hoe to update a plot

2010-02-23 Thread Stephen George
C M wrote:
> On Tue, Feb 23, 2010 at 7:00 PM, Mathew Yeates  wrote:
>   
>> Hi
>> I am using gtk and displaying a plot in a FigureCanvas. In response to an
>> event, I want to update the plot with new data.
>>
>> e.g.
>> self.fig = Figure(figsize=(5,5), dpi=100)
>> self.ax = fig.add_subplot(111)
>> ax.plot(data[0,0:,0],
>>
>>
>>
>> canvas = FigureCanvas(fig)
>> canvas.set_size_request(500,500)
>>
>> def on_some_signal(self,widget):
>> ?
>>
>>
>> I've tried a number of different things. How do you do this?
>> 
>
> I may be wrong here, but isn't it:
>
> def on_some_signal(self,widget):
> ax.plot(yournewdata)
> canvas.draw()
>
> Che
>
>   
I also may be wrong.

I thought ax.plot(..) would redraw everything (ticks, labels, etc)  to 
do with the plot.

I've been using set_data as I thought it was meant to be quicker.
self.cline[0].set_data(rX, myabs) # I have to make sure 
I use correct line
 ::  ::
self.canvas.draw()

To just change the data associated with a specific line on plot.

I stored the lines on my graph in a list called cline,  I captured the 
line at time of creating of the plot
r = self.axis.plot( rX, myabs ,self.linestyle, color='b')
self.cline.append( r[0] )


- Steve




--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting in a loop

2010-04-20 Thread Stephen George

Hi,

Sorry haven't used ipython, so not sure if there is another/better 
ipython way.


Attached is how I solved it in normal python.
I added a "next line" button to the graph, and set the ydata for the 
line each time the button is pushed.


There is a couple of set_ylim lines commented out, depending on the 
nature of your data, it might be appropriate to uncomment one of those, 
however the set_aspect line may might mean the graph is very tall and 
skinny with the supplied data.


Hope that gives you some ideas for your own code.

Steve


On 21/04/2010 3:35 AM, tomislav_ma...@gmx.com wrote:

Hello everyone,

if I read a column file like this (simplified to integers):

0 1 2 3
1 2 3 4
2 3 4 5
3 4 5 6

with: "data = np.loadtxt("fileName")", why can't I use a for loop 
inside ipython (started with "-pylab" option) to plot each of the 
Line2D objects and then draw them on the plot? I am using matplotlib 
to debug a computational geometry code and I would like these lines to 
plot paused by the user input so that I can identify when (where) 
exactly the wrong calculations happen:



import numpy as np

import matplotlib.pyplot as plt

fig1 = plt.figure()

ax1 = fig1.add_subplot(111)

ax1.set_aspect("equal")

for line in data:

raw_input("press enter to plot the line")

ax1.plot([line[0],line[2]],[line[1],line[3]],'b')

plt.draw()



This way I could see with pressing e.g. the return key when my 
calculations go wrong any advice?





--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   


import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Button

imin = 
imax = 0
displayline = 0

data = np.loadtxt("fileName")
for line in data:
imin = min(imin, min(line))
imax = max(imax, max(line))

fig1 = plt.figure()
ax1 = fig1.add_subplot(111)
ax1.set_aspect("equal")
r, = ax1.plot(data[displayline],'b')

#ax1.set_ylim(imin , imax) 

#where rect=[left, bottom, width, height] in normalized (0,1) units
controlax = fig1.add_axes([0.85, 0.1, 0.1, 0.04])
button = Button(controlax, 'Next Line')

def nextline(event):
global displayline
displayline += 1
if displayline >= len(data):
displayline = 0 #start cycle again
r.set_ydata(data[displayline])  
#ax1.set_ylim(min(data[displayline]) , max(data[displayline]))
plt.draw()

button.on_clicked(nextline)

plt.show()--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Replotting

2010-04-22 Thread Stephen George

On 23/04/2010 10:30 AM, williamol...@comcast.net wrote:
I use pylab.plot(x,y) for exploring or debugging some functions or 
subroutines.
I would like to cycle through 2 or more plot windows, in a simple way 
that won't force me to entangle the code in bothersome ways.  But I 
can't seem to get more than one plot window to open per launch.


Here is an example of what I want to have happen:

  The program calls subroutine A, and creates a plot so that  I can 
see what it has done.
  The plot opens, and I see that A is doing what I want, then I close 
the plot window (I interactively click the close button).
  Then the program calls subroutine B, and creates another plot so I 
can check its results.

  The plot opens, I see what I want and close it.
  And so on.

But I can't figure out how to make that work.  Only one plot ever shows.

Here is a very minimal example of what I have tried:

import numpy as N
import pylab as P

x = N.linspace(0,6,100)
y = N.sin(x)

P.plot(x,y)
P.show() # At this point, I want to see what I've got, and 
then move on.


y = -y
P.plot(x,y)
P.show() # This plot will not show.

The answer for me is not to use "subplot()".  I already use that 
often.  But I want these plots to stand on their own, so that I don't 
have to entangle the different pieces of code just for some 
exploratory plotting.


I hope someone has an easy solution!
Thanks,
Bill


Hi,

I gave a solution just a couple of days ago, I believe the similar 
approach could solve this problem also

http://old.nabble.com/plotting-in-a-loop-td28306656.html

Essentially, . each time you press a button on graph (not the close 
button) you generate an event which would call an update function, you 
could farm out work to perform subroutine B here, then replot the result.


Steve

--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] dynamically updated plots

2008-07-14 Thread Stephen George
Hi Lubos,

Lubos Vrbka wrote:
>> 1. Would it be possible to do only shallow copy of the arrays that are
>> being plotted so that on redrawing the figure, chanes in the datasets
>> would be picked up automatically? If not, is Line2D.set_data(...) the
>> right approach?
>> 
> isn't this the way how the plotting is done? in my experience (iirc), 
> the following thing works (x, y1, y2 are numpy arrays):
>
> pylab.ion()
>
> a, = pylab.plot(x,y1)
> b, = pylab.plot(x,y2)
> ...
> y1 += 10
> y2 += 20
>
> a.set_ydata(y1)
> b.set_ydata(y2)
> pylab.draw()
>
> y1 += 10
> y2 += 20
> a.set_ydata(y1)
> pylab.draw()
>
> in my experience BOTH plots get updated in this procedure, so i have to 
> do first a deep copy in my case to get rid of these 'unwanted effects'...
>   
If I understand correctly the len of  X and Y will be changing, 
therefore you may have to use set_data() function of Line2D

set_data(self, *args)
Set the x and y data
ACCEPTS: (array xdata, array ydata)

I seem to remember getting a size mismatch if X and Y grew in length and 
I tried to use set_xdata() or set_ydata() separately.

YMMV
Steve

-
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] How to set the unit (scale factor, x1e5) on x axis?

2008-09-14 Thread Stephen George
Hi Fernando,
> So, I want to plot a line, but controlling the labels on the tickers 
> of the x axis. For instance, if I'm plotting (1000, 5),  (2000, 10), 
> (3000, 10), the ticks on the x axis might show 1000 2000 3000 
>or 1  2  3x1e3. I want to control it, set it to 1 
> and obtain the first example, and set to 1000 and obtain the second one.
I not 100% clear what you want to achieve, however look into your 
matplotlib distribution for ticker.py

There is Formatter classes that control such things.

For example the existing ScalarFormatter, has a method set_scientific() 
to enable /disable scientific formatting. My reading of your description 
suggests this is what you are after or you might get some joy out of 
set_powerlimits()  or the argument useOffset.

If your requirements are different you may need to create your own 
formatter class.

Steve

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] One more question regarding to boxplotting

2009-05-12 Thread Stephen George

Why don't you perform a histogram on the data that produced that 
boxplot, .. seeing the shape of that histogram may answer your own 
question. Is it skewed or normal distribution?

Gökhan SEVER wrote:
> Hello,
>
> I construct my boxplots (shown in this figure: 
> http://img204.imageshack.us/img204/7518/boxplot2.png) using 5th, 25th, 
> 50th, 75th, 95th percent of my data explicitly. For some reason on 
> boxplot 3 and 5 on the figure I get fliers instead of whiskers on the 
> lower parts.
>
> Do you have any idea what could be the reason for this behaviour?
>
> Gökhan
> 
>
> --
> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
> production scanning environment may not be a perfect world - but thanks to
> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with all image 
> processing features enabled. http://p.sf.net/sfu/kodak-com
> 
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   



--
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Using labels with "twinx()"

2011-09-28 Thread Stephen George

On 28/09/2011 4:32 PM, Klonuo Umom wrote:

Please consider:

plot([1, 2, 3, 4], label='line 1')
twinx()
plot([11, 12, 11, 14], label='line 2')
legend()


will draw only label for 'line 2'

plot([1, 2, 3, 4], label='line 1')
legend()
twinx()
plot([11, 12, 11, 14], label='line 2')
legend()


same result, as it will overwrite label 'line 1' with label 'line 2'

How to deal with this, without manually positioning legends and if 
possible including all annotated plot lines in one legend?



Thanks



I would do something like

   from matplotlib import pylab

   LegendText = []

   pylab.twinx() # << had to move before first plot else it blew up

   pylab.plot([1, 2, 3, 4] )
   LegendText.append('line 1')

   pylab.plot([11, 12, 11, 14])
   LegendText.append('line 2')

   pylab.legend( LegendText , loc='lower right')

   pylab.show()


Don't know if there is a better way
Steve
--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] how to stop resize when adding scatter plot?

2010-06-22 Thread Stephen George

Hi,

I have an application that draws a line plot of  a spectrum. When the 
spectrum is collected different gains and filters may be used for each 
data point (which I have also collected). I am looking at artefacts in 
the spectrum and trying to correlate them with things such as the gain 
and filter changes etc.

On the application I have a number of radio buttons, when clicked will 
add a scatter plot of the datapoints but color coded by the item of 
interest.
i.e.
click the gain btn  I end up with the line plot, and each data point has 
a color coded dot whose color is keyed to the gain the data point was 
taken at.
click the filter btn  I remove the gain scatter plot, and add a filter 
scatter plot where each data point is color coded with the filter used.

This functionality work fine.

However if I am zoomed in on my graph looking at detail, then click the 
radio button, the scatter plot forces the graph to resize to once again 
show the overall intial view (zoomed out).

I am wondering how can I add the scatter plot, without changing the 
current view (zoom level) that I am currently using, but still add all 
the scatter plot data?

Any suggestions gratefully accepted.

Steve


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] how to stop resize when adding scatter plot?

2010-06-22 Thread Stephen George

>> However if I am zoomed in on my graph looking at detail, then click the
>> radio button, the scatter plot forces the graph to resize to once again
>> show the overall intial view (zoomed out).
>>  
> Try using:
>
> axes.set_autoscale_on(False)
>

Thank you very much, this does exactly what I was after.

I call this BEFORE adding my scatter plot, and the current view (zoom 
in) remains.

Much appreciated, thanks again

- Steve

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] error: Gtk* backend requires pygtk to be installed

2010-06-24 Thread Stephen George

Hi  Mike,

I tried to run it on windows.

Got error
D:\download\python>demo_axes_grid.py
Traceback (most recent call last):
  File "D:\download\python\demo_axes_grid.py", line 2, in 
from demo_image import get_demo_image
ImportError: No module named demo_image

Went looking on examples page and found there was a file name demo_image.py
http://matplotlib.sourceforge.net/examples/axes_grid/demo_image.html

However for whatever reason the source code was not downloadable (404 
error), so I copied it off the html page.


After that the example ran fine under windows, ... I have never 
installed anything called 'dsextras' and don't know what it is.


However it doesn't look like a gtk GUI to me., a quick check of the code 
reveals no gtk type commands or imports?
I'd be questioning your configuration of matplotlib, there should be a 
rc file somewhere, maybe you (or your distro) have set the backend to 
gtk by default?
I don't have a system here without gtk installed, that I could test 
example runs without it installed - sorry.


(what distro and what's a pip command?)

- Steve


On 23/06/2010 11:09 PM, Mike Anderson wrote:

Hi,

I'm trying to run a demo example,
http://matplotlib.sourceforge.net/plot_directive/mpl_toolkits/axes_grid/figures/demo_axes_grid.py

ran into this problem saying pygtk was needed:

$ curl 
http://matplotlib.sourceforge.net/plot_directive/mpl_toolkits/axes_grid/figures/demo_axes_grid.py 
> demo_axes_grid.py


$  python demo_axes_grid.py
Traceback (most recent call last):
  File "demo_axes_grid.py", line 1, in 
import matplotlib.pyplot as plt
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/pyplot.py", 
line 78, in 

new_figure_manager, draw_if_interactive, show = pylab_setup()
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/backends/__init__.py", 
line 25, in pylab_setup

globals(),locals(),[backend_name])
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/backends/backend_gtkagg.py", 
line 10, in 
from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK, 
FigureCanvasGTK,\
  File 
"/Library/Frameworks/Python.framework/Versions/Current/lib/python2.6/site-packages/matplotlib/backends/backend_gtk.py", 
line 11, in 

raise ImportError("Gtk* backend requires pygtk to be installed.")
ImportError: Gtk* backend requires pygtk to be installed.



Then I tried to install pygtk:

$  pip install pygtk
Downloading/unpacking pygtk
  Running setup.py egg_info for package pygtk
Traceback (most recent call last):
  File "", line 14, in 
  File 
"/Users/michaelanderson/root/mikeWork/2010June/temp/build/pygtk/setup.py", 
line 22, in 

from dsextras import get_m4_define, getoutput, have_pkgconfig, \
ImportError: No module named dsextras
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

  File "", line 14, in 

  File 
"/Users/michaelanderson/root/mikeWork/2010June/temp/build/pygtk/setup.py", 
line 22, in 


from dsextras import get_m4_define, getoutput, have_pkgconfig, \

ImportError: No module named dsextras


Command python setup.py egg_info failed with error code 1
Storing complete log in /Users/michaelanderson/.pip/pip.log


Ok, then I tried to install dsextras:
$  pip install dsextras
Downloading/unpacking dsextras
  Could not find any downloads that satisfy the requirement dsextras
No distributions at all found for dsextras
Storing complete log in /Users/michaelanderson/.pip/pip.log


What is this obscure package (dsextras) and is it really necessary to 
run the shared axes demo?


Mike


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
lucky parental unit.  See the prize list and enter to win:
http://p.sf.net/sfu/thinkgeek-promo


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Win7. Why Don't Matplotlib, ... Show up in Control Panel Add-Remove?

2010-08-08 Thread Stephen George
  On 9/08/2010 9:19 AM, Wayne Watson wrote:
> See Subject. I use matplotlib, scipy, numpy and possibly one other
> module. If I go to the control panel, I only see numpy listed. Why? I
> use a search and find only numpy and Python itself. How can matplotlib
> and scipy be uninstalled?
>
In my Win7 (64bit) I have 32 bit python 2.6 installed.

matplotlib and numpy show under the add remove program functionality

"Python 2.6 matplotlib-0.99.3"
"Python 2.6 numpy-1.4.1"

Along with heaps of other libraries I have installed

Are you sure matplotlib is installed AND working?

To remove I can only suggest you install again and then remove

Steve

--
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problem with MPL+py2exe (wx app needs qt?)

2010-09-14 Thread Stephen George
  On 14/09/2010 8:18 AM, Carlos Grohmann wrote:
> Many thanks, that helper.
>
> After some more problems with scipy, I got a working EXE.
>
> PyQt4 is still in the library, though. Eating almost 15Mb... Now all I
> have to do is to find out how to remove it..
>
>
> cheers
>
> Carlos
>

Have you read the info on py2exe wiki relating to matplotlib

http://www.py2exe.org/index.cgi/MatPlotLib
Have a look at  section on "Backends"

Steve

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Saving image on Windows problem

2007-01-30 Thread Stephen George





Has anyone else noticed a problem when saving an image (png) on windows.
Hard to describe, .. but it seems that if there is lots of data to plot
and window size too big, or maximized, it cannot save the full plot
data stopping half way. (plot look fine on window).   Interesting
reducing the window size can get to the point where can save the full
image.

Good plot (small window size)
http://members.optusnet.com.au/~steve_geo/MatPlotLibTests/12p5KInternalIR_InputGndGood.png

Failed plot (larger window size)
http://members.optusnet.com.au/~steve_geo/MatPlotLibTests/12p5KInternalIR_InputGndFailed.png

I get the same problem on two different systems:
Windows XP & Python 2.4 & matplotlib & numarray 1.5.2
matplotlib installed from matplotlib-0.87.6.win32-py2.4.exe
matplotlibrc has 
backend  : TkAgg
numerix  : numarray  # numpy, Numeric or numarray
interactive  : False  # see 
  

Windows 2000 & Python 2.5 & matplotlib & numpy 1.0
matplotlib installed from matplotlib-0.87.7.win32-py2.5.exe
matplotlibrc has 
backend  : TkAgg
  numerix  : numpy  # numpy, Numeric or numarray
  #interactive  : False  # see http://matplotlib.s


find my data here
http://members.optusnet.com.au/~steve_geo/MatPlotLibTests/ScanDataInternalIR_GndInput.log

and the script here (only tested with numpy and numarray)
http://members.optusnet.com.au/~steve_geo/MatPlotLibTests/irplot24.py

the command to reproduce the test is 
irplot24.py --second=fft
--target=60 ScanDataInternalIR_GndInput.log

=
Also it's also interesting to note the difference in load time
(sec) of the data between numarray and numpy for the same data.
Windows 2000 & Python 2.4 & matplotlib &
numarray
X:\srg\MatPlotLibTests>c:\python24\python ..\irplot24.py
--second=fft --target=60 ScanDataInternalIR_GndInput.log
Importing pylab library  1.685
Opening file and loading array . 3.999

Windows 2000 & Python 2.5 & matplotlib & numpy
X:\srg\MatPlotLibTests>c:\python25\python ..\irplot24.py
--second=fft --target=60 ScanDataInternalIR_GndInput.log
Importing pylab library  0.882
Opening file and loading array . 10.687



Thanks for any comments
Steve




-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Getting resize_event to work

2007-03-21 Thread Stephen George

Trying to get resize event to work, but either I don't understand the 
definition of when resize_event should work, or  it's broken.

for example
===
from matplotlib import pylab , numerix

def GotResizeEvent( event ):
print 'Resize event detected'

def GotDrawEvent( event ):
print 'Draw event detected'

X = range(0, 200)
Y = pylab.sin(X)

r = pylab.plot(X,Y)
pylab.connect( 'resize_event', GotResizeEvent)
pylab.connect( 'draw_event', GotDrawEvent)
pylab.show()
=
Will only get draw_events as I zoom in on the data, never a resize event?
I also get draw_events as I resize the window itself, but never a 
resize_event.

So my question, .. what user activity triggers a resize event?

Numerix Version: numpy 1.0
MatPlotLib Version: 0.87.7

Steve



-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] trig plot from event?

2007-03-21 Thread Stephen George

I have two plots.

first one is velocity data from servo controller (freq)  - plant 
reciprocates back and forth so we got turn data in there as well
second one is psd  (power spectral density) so we can see where we got 
resonances etc.

When we zoom in on on section of first plot (say the forward movement), 
I'd like to recalc the psd with only the data that's been zoomed in on.

Everything kind of works except for somewhere to trigger from.

I had thought of trying resize_event - however I cannot get this 
working- see other post.

I played with button_release_event to get the code basically working, 
however that event occurs before the first graph gets resized, so the 
region I am calculating the psd on is wrong, maybe because I am using
xlim = myAxis.get_xlim()
to find the limits of the first graph (which hasn't been re-drawn yet)

Is there some way I can hook the re-calc/draw of psd to the zooming of 
first graph?

Previously with 2 plot commands, I have used subplot(212, sharex=p1), to 
hook the two graphs together on the xaxis
however as the second graph is a psd I don't know how to hook the psd 
input data to the xaxis of the first graph.


Thanks
Steve


-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] trig plot from event?

2007-03-22 Thread Stephen George

Creating a 'simplified' example (not really) to demonstrate the problem

Zoom in on one of the constant speed movements.(upper graph)

psd (lower graph) will still be showing spectrum of whole data file.

click 'n release  any mouse button in the upper graph, and only then 
will the lower graph redraw with the new limits.


zoom out, try again on other constant speed movement.

how to get lower graph to redraw on new limits after the zoom, without 
having to click the upper graph again?


Steve

I have two plots.

first one is velocity data from servo controller (freq)  - plant 
reciprocates back and forth so we got turn data in there as well
second one is psd  (power spectral density) so we can see where we got 
resonances etc.


When we zoom in on on section of first plot (say the forward movement), 
I'd like to recalc the psd with only the data that's been zoomed in on.


Everything kind of works except for somewhere to trigger from.

I had thought of trying resize_event - however I cannot get this 
working- see other post.


I played with button_release_event to get the code basically working, 
however that event occurs before the first graph gets resized, so the 
region I am calculating the psd on is wrong, maybe because I am using

xlim = myAxis.get_xlim()
to find the limits of the first graph (which hasn't been re-drawn yet)

Is there some way I can hook the re-calc/draw of psd to the zooming of 
first graph?


Previously with 2 plot commands, I have used subplot(212, sharex=p1), to 
hook the two graphs together on the xaxis
however as the second graph is a psd I don't know how to hook the psd 
input data to the xaxis of the first graph.



Thanks
Ste
  


4013
3996
4007
3992
4009
3992
4005
4008
4003
4000
4011
3994
4005
3994
4013
3992
4005
4002
4003
4006
4005
3998
4003
4000
4009
3996
4007
3994
4011
3996
4011
3992
4007
4000
4007
4000
4007
3996
4003
3992
4011
3996
4007
3996
4009
3992
4011
4000
3999
4002
4001
4000
4011
3998
4005
3994
4009
3988
4009
4000
4005
4002
4005
4000
3999
3998
4011
3988
4013
3994
4011
3996
4011
3996
3999
4000
4005
3998
4003
3996
4015
3994
4009
3986
4007
3994
4013
3994
4015
3996
4007
3998
4003
3994
4009
3994
4007
3996
4011
3992
4007
3996
4007
3990
4011
3992
4007
3992
4011
3992
4011
3996
4001
3994
4005
3998
4003
4002
4003
3994
4003
3998
4009
3994
4011
3992
4003
3996
4009
3992
4005
3998
4007
3994
4007
3992
3999
3994
4011
3994
4007
3998
4005
3994
4005
3990
4007
3994
4005
3994
4013
3988
4009
3992
4005
3994
3999
3998
4009
3992
4005
3998
4009
3984
4011
3988
4011
3988
4013
3992
4007
3994
4003
3992
4011
3986
4009
3990
4015
3990
4003
4000
4003
3994
4003
3990
4011
3992
4007
3994
4009
3990
4007
3986
4011
3994
4005
3992
4003
3994
3999
3998
4011
3984
4013
3986
4007
3990
4007
3996
3999
4000
4009
3990
4011
3988
4005
3992
4007
3990
4011
4000
4011
3984
4009
3990
4001
3998
4003
3998
4007
3998
4005
3992
4005
3990
4003
3990
4009
4000
4003
3992
4011
3988
4007
3988
4013
3992
4007
3996
4005
3996
4001
3996
4005
3994
4009
3990
4011
3992
4005
3992
4011
3990
4009
3996
4003
3998
4007
3990
4003
3998
4003
3994
4007
3994
4007
3992
4005
3994
4561
3832
4747
4032
5075
4356
5369
4590
5581
4696
5609
4592
5493
4450
5403
4342
5371
4338
5375
4462
5471
4604
5619
4764
5771
4934
5983
5086
6215
5208
6473
5362
6597
5494
6713
5600
6791
5680
6923
5880
7217
6170
7723
6616
8225
7108
8665
7476
9195
8028
10255
9264
12099
11218
14307
12752
18021
22576
73259
25512
19761
12536
13269
9788
10761
8528
9681
7732
8783
7024
8041
6396
7713
6230
7287
5974
7035
5758
6779
5544
6485
5322
6219
5176
6083
5000
5955
4936
5841
4828
5743
4706
5619
4596
5511
4530
5375
4442
5311
4400
5255
4330
5199
4304
5143
4206
5077
4152
4957
4088
4901
4040
4833
3994
4797
3962
4767
3946
4757
3926
4729
3908
4691
3842
4673
3816
4607
3808
4551
3776
4513
3748
4515
3726
4463
3706
4475
3674
4433
3658
4415
3620
4403
3606
4349
3586
4343
3594
4323
3586
4311
3548
4319
3560
4275
3524
4299
3520
4237
3480
4233
3460
4205
3440
4175
3456
4163
3450
4167
3434
4153
3450
4183
3414
4187
3426
4157
3412
4153
3396
4133
3380
4123
3364
4119
3364
4109
3362
4107
3362
4105
3358
4101
3340
4097
3334
4057
3324
4085
3326
4053
3282
4075
3314
4039
3296
4073
3296
4061
3298
4079
3302
4055
3314
4061
3288
4067
3286
4025
3296
4023
3284
4007
3268
4013
3256
4013
3270
4017
3256
4033
3242
4045
3260
4019
3274
4015
3264
4009
3262
4009
3248
4017
3246
4019
3252
4013
3262
4023
3270
4009
3270
4009
3266
4011
3260
4009
3268
3997
3250
4009
3228
4013
3244
3987
3264
3969
3268
3979
3276
3971
3268
3987
3270
3995
3252
4017
3254
3987
3282
4023
3254
4019
3250
4019
3254
4013
3262
4001
3270
4005
3254
4013
3250
4009
3270
4007
3256
4021
3278
3953
3322
4025
3250
4029
3272
4009
3296
3993
3298
4003
3298
3995
3302
4005
3294
4043
3298
4025
3304
4023
3310
4029
3310
4039
3308
4017
3316
4011
3300
4047
3300
4011
3332
3993
3310
4035
3328
4023
3328
4015
3318
4057
3328
4023
3336
4057
3314
4041
3326
4063
3334
4027
3340
4067
3346
4049
3344
4051
3354
4053
3346
4051
3340
4075
3348
4069
3352
4047
3358
4065
3348
4071
3370
4069
3352
4075
3362
407

[Matplotlib-users] get_xlim() - where am I going wrong

2007-06-13 Thread Stephen George

Hi,

I have 2 graphs on one figure.
Graph one - subplot(2,1,1)velocities vs  ( Time or SampleIndex) 
depending in input args
Graph two - subplot(2,1,2)   psd() - power spectrum to help us find the 
resonances in velocities

As system goes through a number of different states, the resonances 
change during the cycle, so I need to zoomIn GraphOne to an area of 
interest, then re-calc the power spectrum on that portion of data only.

I have something that works in the xaxis=SampleIndex scenario, but fails 
in the xaxis=Time scenario, I am wondering if I am going about it the 
right way.

The following page has 4 graphs that show what I have working now (2 
graphs of velocity vs SampleNo), and the failing case (2 graphs of 
Velocity Vs Time)
*http://tinyurl.com/2xpyly
*
I'll describe what I got.

I connected my function RecalcPowerSpectrum  to ReleaseButton event
pylab.connect( 'button_release_event', RecalcPowerSpectrum)


It's ugly and crude, but if GraphOne is a velocity vs sampleIndex, the 
following works.
My issues start when you look at how I am slicing (if thats the right 
word) the array I pass into psd() and where those values come from.

def RecalcPowerSpectrum( event ): 
global myAxis
global lastXstart
global lastXend

xlim = myAxis.get_xlim()

xstart = int(xlim[0])
xend = int(xlim[1])
   
if xstart != lastXstart or xend != lastXend:
print '%s event detected, re-calc power spectrum' % event.name
lastXstart, lastXend = xstart, xend
lastXlimits = xlim
print 'xlim1 =', xstart
print 'xlim2 =', xend   
pylab.cla()
if secondGraph == 'fft':# (plot UDR1 points)
Fs = 2 * targetvel
fftdata = pylab.psd(vel[2*xstart:2*xend], NFFT=winsize, 
Fs=Fs, detrend=pylab.mlab.detrend_linear, 
window=pylab.mlab.window_hanning, noverlap=overlap)
else: #must be a fft2 (plot UDR2 points)
Fs = targetvel
fftdata = pylab.psd(combined[xstart:xend], NFFT=winsize, 
Fs=Fs, detrend=pylab.mlab.detrend_linear, 
window=pylab.mlab.window_hanning, noverlap=overlap)


This fails when I run my program to plot with xaxis in time as the 
values returned by get_xlim() are small (0.46408074411240841, 
0.53334652681575301), once I int() these values they are both 0

Clearly I am trying to work with the wrong values. I actually want to 
get the indexes of these values. So I can pass the proper slice of the 
original array into the psd function.


So my questions.
1) Is there a way to get the indexes (not the values) of the portion of 
the line actually showing on screen
2) Is there a way to get a copy of the portion of the data displayed on 
screen (in a new array) ?
3) Is there a better way of linking psd so it performs the spectrum 
analysis only on the portion of data on screen?

*
*Thanks for your help
Steve

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] get_xlim() - where am I going wrong

2007-06-14 Thread Stephen George
Hi John,

This is absolutely fantastic, does everything I want, 1/2 hr after 
getting to work, I had it up and running in my application.

I do have a question though.

I had not seen mention of SpanSelector before in documentation.
And I do feel confusion about where to find the best documentation.

I look on the web site, and I can see a pylab API 
http://matplotlib.sourceforge.net/pylab_commands.html
I can see another page with MatPlotLib interface  
http://matplotlib.sourceforge.net/matplotlib.pylab.html#-cla
both of which make no mention of SpanSelector

After seeing you use this command I had another look on web site and saw 
a link to API (pdf)  http://matplotlib.sourceforge.net/api.pdf
Which does have a section on SpanSelector

I did a search on the Wiki and couldn't find an entry for SpanSelector

On the forums I have heard about an OO interface.

I am Sooo confused where I should go and look for documentation now, 
 how can I learn little gems like this?, Which interface should I use?

Love using MatPlotLib/pylab, whatever it's called, I've found it quick 
to get something up and running, the forums are great for snippets of info
and I would love to get a deeper understanding of the capabilities of 
this tool.

Thanks
Steve

John Hunter wrote:
> On 6/14/07, steve george <[EMAIL PROTECTED]> wrote:
>>
>> WOW - I delayed my bed time when I saw this come in.
>> It certainly seems to do what I want in your example.
>>
>> Tomorrow at work I'll try and fit it into my frame work, and see what
>> happens.
>
> Try setting the useblit=True parameter in the SpanSelector -- you'll
> get much better responsiveness.   I accidentally left it off in the
> code I posted.
>
> JDH
>
   

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting filled circles

2007-07-01 Thread Stephen George
Hi,

being a newbie myself, .. I don't know if I'm misguiding you. But do 
wonder if you looked at the scatter command
see scatter_demo2.py on
http://matplotlib.sourceforge.net/screenshots.html for an example

It *seems* like it already does what you are trying to do?, maybe I'm 
missing something in my understanding.

Steve



Andrew McLean wrote:
> I'm a new user of matplotlib (athough I have been using both Matlab and
> Python for years).
>
> I have an application where I need to display data as a set of filled
> circles. The centre and the radius of the circles are both specified in
> data coordinates. The data points have an additional scalar attribute,
> which is displayed using a pseudo-colour mapping.
>
> I've hacked something together where the circles are approximated by
> polygons using either the axis fill method or the pylab fill function. I
> select the colour by calling the get_rgba method of a ScalarMappable
> object. In the following code snippet c is a tuple containg the x and y
> coords of the centre of the circle, the radius, and a scalar "value"
>
> theta = arange(numSegs+1) * 2.0 * math.pi / numSegs
> cos_theta = cos(theta)
> sin_theta = sin(theta)
> for c in cart:
> x = c[1] + c[3] * cos_theta
> y = c[2] + c[3] * sin_theta
> v = c[4]
> fill(x, y, facecolor=mapper.to_rgba(v), linewidth=0.5)
>
> It all works. However, I saw in the API documentation (and the source)
> that there is a Circle object in patch. I was hoping that using this
> rather than polygons would give better quality output and possibly
> smaller files. Now I can instantiate it
>
> circle = Circle((x,y), c[3], facecolor=cmapper.to_rgba(v))
>
> but can't work out what to do with it! I've tried
>
> ax.add_patch( circle )
>
> and also
>
> trans = blend_xy_sep_transform( ax.transAxes, ax.transData  )
> circle.set_transform( trans )
> ax.add_patch( circle )
>
> Neither work. Any ideas?
>
> Regards,
>
> Andrew
>
>
>
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>   


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Small negative values causing graph breaks?

2007-10-11 Thread Stephen George

Hi Joshua,

As you can see from the attached graph, there is a break the in graph 
somewhere around 7 AM or so.  This is the data I am graphing for that red 
line:


"2007-10-09 00:00:00",0.015
"2007-10-09 01:00:00",0.015
"2007-10-09 02:00:00",0.014
"2007-10-09 03:00:00",0.012
"2007-10-09 04:00:00",0.008
"2007-10-09 05:00:00",0.002
"2007-10-09 06:00:00",-0.006
  


If I change the -0.006 at 6:00AM to 0.006, it graphs with no break in the 
line. 

Can not comment on Matplotlib, ... but what method are you using the
process your input?
RegEx or other ?, can it handle negative input?

The attached script has missing data points where the data point in None

Don't know if that helps
Steve

from matplotlib import pylab , numerix

X1= [ 0.3, 1.2 , -4.3 , 2.5, 2.5, -1.5, 1.2, .8 , 3.5 ]
X2= [ 0.3, 1.2 , None , 2.5, 2.5, -1.5, None, .8 ,3.5 ]

ax1 = pylab.subplot(2,1,1)
pylab.plot(X1, marker='o')
ax1.set_ylim(-5,3)

ax2 = pylab.subplot(2,1,2)
pylab.plot(X2, marker='o')
ax2.set_ylim(-5,3)


print type(X1[0])
print type(X2[0])
pylab.show()
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] two distributions on a histogram

2007-11-11 Thread Stephen George
See below for Antonio Gonzalez solution (last year)  that I have started 
using and happy with it

Neil M wrote:
> Hello,
>
> Is it possible to plot two histograms on the same axis without having
> the bars on top of each other.
>
> I'm trying to determine how similar a distribution of activity is
> between a large data set and a small subset.
>
> I have 2 million records with a last activity date.  I can plot both
> the sample and the full population on a normalized histogram, and in
> different colours but the later plot covers smaller values of the
> earlier one.
>
> Thanks
> Neil
>   

 Original Message 
Subject:Re: [Matplotlib-users] plotting overlapped histograms
Date:   Mon, 13 Nov 2006 19:02:03 +0100
From:   Antonio Gonzalez <[EMAIL PROTECTED]>
To: David E. Konerding <[EMAIL PROTECTED]>
CC: Matplotlib-users@lists.sourceforge.net
References: <[EMAIL PROTECTED]>



To compare two histograms you can plot a bihistogram as suggested on
http://www.itl.nist.gov/div898/handbook/eda/section3/bihistog.htm

The little function I've written to do so is below. See if it helps.

Antonio



import scipy
from pylab import figure

def bihist(y1, y2, nbins=10, h=None):
'''
Bihistogram.
h is an axis handle. If not present, a new figure is created.
'''
if h is None: h = figure().add_subplot(111)
xmin = scipy.floor(scipy.minimum(y1.min(), y2.min()))
xmax = scipy.ceil(scipy.maximum(y1.max(), y2.max()))
bins = scipy.linspace(xmin, xmax, nbins)
n1, bins1, patch1 = h.hist(y1, bins)
n2, bins2, patch2 = h.hist(y2, bins)
# set ymax:
ymax = 0
for i in patch1:
height = i.get_height()
if height > ymax: ymax = height
# invert second histogram and set ymin:
ymin = 0
for i in patch2:
height = i.get_height()
height = -height
i.set_height(height)
if height < ymin: ymin = height
h.set_ylim(ymin*1.1, ymax*1.1)  
h.figure.canvas.draw()

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users



-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Adding another control to navigation bar

2007-11-29 Thread Stephen George


I don't know if I dreamed it or was real, but I recall seeing somewhere 
that it was possible to add a control to the navigation bar, but now 
cannot seem to find any reference to this.

Is is possible to add a control to the navigation bar? (I want to add a 
drop down box)
I am using pyGtk, can add to somewhere else in my form, .. but it makes 
logical sense if it is on the navigation bar.

Any suggestions?
Thanks
Steve


-
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] pylab.save() File Name Syntax

2008-01-31 Thread Stephen George
Hi Rich,

bit confused what your asking.
are you looking for the pylab API savefig
http://matplotlib.sourceforge.net/matplotlib.pyplot.html#-savefig

or you asking how to convert your variable+.png into a filename?
is your variable a number?, string?

for count in range(3):
count = count +1
fname = 'MyPlot_%d.png' %count
print fname

mystr = 'MyFirstPlot'
fname = '%s.png' % mystr
print fname

results in
 >python -u "test.py"
MyPlot_1.png
MyPlot_2.png
MyPlot_3.png
MyFirstPlot.png
 >Exit code: 0


pylab.savefig('%s.png'% curVar)
   or
pylab.savefig('%d.png'% curVar)


Does anything here help?
Steve






Rich Shepard wrote:
>I want to save plots programmatically, using a variable + .png as the
> filename. I don't see an example of the proper syntax, and my
> trial-and-error approach hasn't yielded a solution, either.
>
>If I want to write
>
>   pylab.save(curVar.png)
>
> where 'curVar' is a variable assigned programmatically, how do I correctly
> write it?
>
> Rich
>
>   


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Help with matpoltlib

2008-02-28 Thread Stephen George
Hi Olusina,

I guess you have specific reason to prefer to use python2.4 and not 
install matplotlib into python2.5

I also have 2 versions installed on my computer, .. only one will work 
directly from the command line, the first one found on the path.

however whenever I want to run a test against Version2.4 I can do that 
by calling the interpretor directly and pass the script name

from command prompt
c:\python24\python myscript.py

or if you want to run the interpretor interactively
D:\>
D:\>c:\python24\python
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on 
win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> ^Z

D:\>c:\python25\python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> ^Z

Hope this helps
Steve

olusina eric wrote:
> I am a new user of Python and need to also use matplotlib but I am 
> having some problems which I hope somebody will be able to help me with.
> I have two versions of Python on my laptop that runs on Windows XP. 
> Version 2.4 installed in a folder named python 24 and I also have 
> VisIt which has associated with it Python Version 2.5.  I installed 
> matplotlib for version 2.4 on my laptop and it detected the Python 
> version 2.4 and installed itself in the right folder. However I can 
> only use Python 2.4 when I am in this folder (c:\python24\). When I 
> call python from any other folder is loads the 2.5 version.
> For the other version of Python (the 2.5 version) I can call this 
> version from any directory but when I installed matplotlib for Python 
> version 2.5, it will not import pylab even though I can call this 
> version of Python from any folder.
> The problem I have is I have a working folder with subfolders and I 
> need to use pylab for some plots. If I call python from this folder it 
> loads 2.5, which will not import pylab. I put the working folder in 
> c:\python24\ and it still calls 2.5 version.
> How can I get my system to call python 2.4 from any folder
> Or
> Get python 2.5 to import pylab.
> I have put the path for both versions of python as shown below:
> Path to Python version 2.5:
> C:\Program Files\LLNL\VisIt 1.6.1\Python\Lib;C:\Program 
> Files\LLNL\VisIt 1.6.1\Python\DLLs;C:\Program Files\LLNL\VisIt 
> 1.6.1\Python\Lib\lib-tk
>  
> Path to Python version 2.4:
> C:\Python24\Lib;C:\Python24\DLLs;C:\Python24\Lib\lib-tk
>  
> Thanks for your help
> Eric
>
> 
> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try 
> it now. 
> 
>  
>
> 


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Strange Plotting Behavior When Extremely Zoomed

2008-04-27 Thread Stephen George
Hi Sunzen,

I also get similar results as you. - always have

'extremely zoomed' means I pick a corner of your staircase, and zoom in 
on the corner multiple times, each time no bigger than the cross hairs 
of the cursor.

If I don't get the blocked out triangles I get the data changing direction

i.e. if looking at

   |
---

I might see
---or  |__  or  __|  
   |

I've seen similar results with other graphic toolset (not python based)

I feel it something to do with zooming in beyond the resolution of the 
underlying system (no evidence of this)

Steve

Sunzen Wang wrote:
> Oh, a pity.
> While it's true that it is easily reproduced on my system and also my 
> users'.
> On my system, matplotlib is 0.90.1, and gtkagg backend is used.
>
> Thank you for your attention.
>
> Regards
> On Fri, Apr 25, 2008 at 8:15 PM, Michael Droettboom <[EMAIL PROTECTED] 
> > wrote:
>
> I'm not able to reproduce this bug.  What version of matplotlib
> are you using and which backend?
>
> Cheers,
> Mike
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA
>
>
> -- 
> sunzen
> <>
>
> 


-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Changing markers on line

2006-11-21 Thread Stephen George

Have a lot of data, and when looking at full view I'd like no markers, 
but when zoom in to see individual points I'd like to place markers on 
the graph.
Planing on attaching some code to events to toggle markers on my line.
Is there a way to change the markers a line uses after it has been 
plotted, or do I have to clear the plot and replot?

Any suggestions appreciated
Thanks
Steve


-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] axis number presentation

2006-11-21 Thread Stephen George
Thank you Pierre,

I've taken a while to get around to it, but this code worked a treat, 
and taught me a little about how I can override things in matplotlib

Thanks
Steve

Pierre GM wrote:
>> One thing I cannot work out is the axis number presentation.
>> Cannot find any documentation about how to control the presentation of
>> the axis number.
>> 
>
> Poke around ticker.formatter
>
>   
>> However I would prefer it would present in enginering notation (10, 100,
>> 1e3, 10e3, 100e3, 1e6, 10e6 ...etc)
>> 
>
> The easiest is to define your own formatter. Please try the solution below. 
> You can use it as:
> gca().xaxis.set_major_formatter(EngrFormatter(3))
>
> # 
> -
> # --- Formatters ---
> # 
> -
> class EngrFormatter(ScalarFormatter):
> """A variation of the standard ScalarFormatter, using only multiples of 
> three
> in the mantissa. A fixed number of decimals can be displayed with the 
> optional 
> parameter `ndec` . If `ndec` is None (default), the number of decimals is 
> defined
> from the current ticks.
> """
> def __init__(self, ndec=None, useOffset=True, useMathText=False):
> ScalarFormatter.__init__(self, useOffset, useMathText)
> if ndec is None or ndec < 0:
> self.format = None
> elif ndec == 0:
> self.format = "%d"
> else:
> self.format = "%%1.%if" % ndec
> #
> def _set_orderOfMagnitude(self, mrange):
> """Sets the order of margnitude."""
> ScalarFormatter._set_orderOfMagnitude(self, mrange)
> self.orderOfMagnitude = 3*(self.orderOfMagnitude//3)
> #
> def _set_format(self):
> """Sets the format string to format all ticklabels."""
> # set the format string to format all the ticklabels
> locs = (N.array(self.locs)-self.offset) / 
> 10**self.orderOfMagnitude+1e-15
> sigfigs = [len(str('%1.3f'% loc).split('.')[1].rstrip('0')) \
>for loc in locs]
> sigfigs.sort()
> if self.format is None:
> self.format = '%1.' + str(sigfigs[-1]) + 'f'
> if self._usetex or self._useMathText: self.format = '$%s$'%self.format
>
>   


-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users