[Matplotlib-users] Turning grid on

2015-06-01 Thread stephen
I am having an issue with the grid not appearing that I cannot figure out.
Can anyone help? Thanks. --StephenB

from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(1,1,1)

x = np.linspace(0,10,50)
y = np.sin(x)

with PdfPages('grid_test.pdf') as pdf:
plt.clf()

plt.clf()
plt.plot(x,y)
leg = plt.legend(['legend 1'])
plt.title('Sample title')
ax.set_ylabel('Sample ylabel')
ax.set_xlabel('Sample xlabel')

ax.set_xticks(np.arange(0, 10, 20))
ax.set_xticks(np.arange(0, 10, 5), minor=True)
ax.set_yticks(np.arange(-1,1,20))
ax.set_yticks(np.arange(-1,1,20), minor=True)

ax.minorticks_on

pdf.savefig()


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


Re: [Matplotlib-users] Turning grid on

2015-06-01 Thread stephen
I only see that you added "plt.show()", but neither the grid or the axis
labels are showing up.

> Here is what I see with a couple of things modified ?
> did you expect something else ?
>
> from matplotlib.backends.backend_pdf import PdfPages
> import matplotlib.pyplot as plt
> import numpy as np
>
> fig = plt.figure()
> ax = fig.add_subplot(1,1,1)
>
> x = np.linspace(0,10,50)
> y = np.sin(x)
>
> with PdfPages('grid_test.pdf') as pdf:
> plt.clf()
>
> plt.clf()
> plt.plot(x,y)
> leg = plt.legend(['legend 1'])
> plt.title('Sample title')
> ax.set_ylabel('Sample ylabel')
> ax.set_xlabel('Sample xlabel')
>
> ax.set_xticks(np.arange(0, 10, 20))
> ax.set_xticks(np.arange(0, 10, 5), minor=True)
> ax.set_yticks(np.arange(-1,1,20))
> ax.set_yticks(np.arange(-1,1,20), minor=True)
>
> ax.minorticks_on
> plt.show()
>
> pdf.savefig()
>
>
> [cid:8C80F2A2-AD50-4E09-B0EF-0596312F5093@ornl.gov]
>
>
>
> On Jun 1, 2015, at 2:49 PM,
> mailto:step...@theboulets.net>>
>  wrote:
>
> I am having an issue with the grid not appearing that I cannot figure out.
> Can anyone help? Thanks. --StephenB
>
> from matplotlib.backends.backend_pdf import PdfPages
> import matplotlib.pyplot as plt
> import numpy as np
>
> fig = plt.figure()
> ax = fig.add_subplot(1,1,1)
>
> x = np.linspace(0,10,50)
> y = np.sin(x)
>
> with PdfPages('grid_test.pdf') as pdf:
>plt.clf()
>
>plt.clf()
>plt.plot(x,y)
>leg = plt.legend(['legend 1'])
>plt.title('Sample title')
>ax.set_ylabel('Sample ylabel')
>ax.set_xlabel('Sample xlabel')
>
>ax.set_xticks(np.arange(0, 10, 20))
>ax.set_xticks(np.arange(0, 10, 5), minor=True)
>ax.set_yticks(np.arange(-1,1,20))
>ax.set_yticks(np.arange(-1,1,20), minor=True)
>
>ax.minorticks_on
>
>pdf.savefig()
>
>
> --
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>



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


Re: [Matplotlib-users] Turning grid on

2015-06-03 Thread stephen
Hm, I tried both suggestions, and still no grid (removed PDF for simplicity):

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(1,1,1)

x = np.linspace(0,10,50)
y = np.sin(x)

plt.clf()

plt.clf()
plt.plot(x,y)
leg = plt.legend(['legend 1'])
plt.title('Sample title')
ax.set_ylabel('Sample ylabel')
ax.set_xlabel('Sample xlabel')

ax.set_xticks(np.arange(0, 10, 20))
ax.set_xticks(np.arange(0, 10, 5), minor=True)
ax.set_yticks(np.arange(-1,1,20))
ax.set_yticks(np.arange(-1,1,20), minor=True)

ax.minorticks_on()
ax.grid('on')
plt.show()



> And if you meant 'grid', I guess
>
>  ax.grid('on')
>
> should be added.
>
> *  Youngung Jeong, 정영웅*
>
> On Mon, Jun 1, 2015 at 4:38 PM, Sterling Smith 
> wrote:
>
>> Stephen,
>>
>> In your script, you give
>> ax.minorticks_on
>> but you need to call that function for anything to occur
>> ax.minorticks_on()
>>
>>
>> Also, did you see
>> http://matplotlib.org/examples/pylab_examples/axes_props.html
>> in case your original question was not answered.
>>
>> -Sterling
>>
>> On Jun 1, 2015, at 1:24PM, step...@theboulets.net wrote:
>>
>> > I only see that you added "plt.show()", but neither the grid or the
>> axis
>> > labels are showing up.
>> >
>> >> Here is what I see with a couple of things modified ?
>> >> did you expect something else ?
>> >>
>> >> from matplotlib.backends.backend_pdf import PdfPages
>> >> import matplotlib.pyplot as plt
>> >> import numpy as np
>> >>
>> >> fig = plt.figure()
>> >> ax = fig.add_subplot(1,1,1)
>> >>
>> >> x = np.linspace(0,10,50)
>> >> y = np.sin(x)
>> >>
>> >> with PdfPages('grid_test.pdf') as pdf:
>> >>plt.clf()
>> >>
>> >> plt.clf()
>> >> plt.plot(x,y)
>> >> leg = plt.legend(['legend 1'])
>> >> plt.title('Sample title')
>> >> ax.set_ylabel('Sample ylabel')
>> >> ax.set_xlabel('Sample xlabel')
>> >>
>> >> ax.set_xticks(np.arange(0, 10, 20))
>> >> ax.set_xticks(np.arange(0, 10, 5), minor=True)
>> >> ax.set_yticks(np.arange(-1,1,20))
>> >> ax.set_yticks(np.arange(-1,1,20), minor=True)
>> >>
>> >> ax.minorticks_on
>> >> plt.show()
>> >>
>> >> pdf.savefig()
>> >>
>> >>
>> >> [cid:8C80F2A2-AD50-4E09-B0EF-0596312F5093@ornl.gov]
>> >>
>> >>
>> >>
>> >> On Jun 1, 2015, at 2:49 PM,
>> >> mailto:step...@theboulets.net>>
>> >> wrote:
>> >>
>> >> I am having an issue with the grid not appearing that I cannot figure
>> out.
>> >> Can anyone help? Thanks. --StephenB
>> >>
>> >> from matplotlib.backends.backend_pdf import PdfPages
>> >> import matplotlib.pyplot as plt
>> >> import numpy as np
>> >>
>> >> fig = plt.figure()
>> >> ax = fig.add_subplot(1,1,1)
>> >>
>> >> x = np.linspace(0,10,50)
>> >> y = np.sin(x)
>> >>
>> >> with PdfPages('grid_test.pdf') as pdf:
>> >>   plt.clf()
>> >>
>> >>   plt.clf()
>> >>   plt.plot(x,y)
>> >>   leg = plt.legend(['legend 1'])
>> >>   plt.title('Sample title')
>> >>   ax.set_ylabel('Sample ylabel')
>> >>   ax.set_xlabel('Sample xlabel')
>> >>
>> >>   ax.set_xticks(np.arange(0, 10, 20))
>> >>   ax.set_xticks(np.arange(0, 10, 5), minor=True)
>> >>   ax.set_yticks(np.arange(-1,1,20))
>> >>   ax.set_yticks(np.arange(-1,1,20), minor=True)
>> >>
>> >>   ax.minorticks_on
>> >>
>> >>   pdf.savefig()
>> >>
>> >>
>> >>
>> --
>> >> ___
>> >> Matplotlib-users mailing list
>> >> Matplotlib-users@lists.sourceforge.net> Matplotlib-users@lists.sourceforge.net>
>> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> >>
>> >>
>> >>
>> >
>> >
>> >
>> >
>> --
>> > ___
>> > Matplotlib-users mailing list
>> > Matplotlib-users@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>> --
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>



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


Re: [Matplotlib-users] Turning grid on

2015-06-03 Thread stephen
But this works:

import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.add_subplot(1,1,1)

x = np.linspace(0,10,50)
y = np.sin(x)

plt.clf()

plt.clf()
plt.plot(x,y)
leg = plt.legend(['legend 1'])
plt.title('Sample title')
plt.ylabel('Sample ylabel')
plt.xlabel('Sample xlabel')

ax.set_xticks(np.arange(0, 10, 20))
ax.set_xticks(np.arange(0, 10, 5), minor=True)
ax.set_yticks(np.arange(-1,1,20))
ax.set_yticks(np.arange(-1,1,20), minor=True)

ax.minorticks_on()
plt.grid(True)
plt.show()


> Hm, I tried both suggestions, and still no grid (removed PDF for
> simplicity):
>
> import matplotlib.pyplot as plt
> import numpy as np
>
> fig = plt.figure()
> ax = fig.add_subplot(1,1,1)
>
> x = np.linspace(0,10,50)
> y = np.sin(x)
>
> plt.clf()
>
> plt.clf()
> plt.plot(x,y)
> leg = plt.legend(['legend 1'])
> plt.title('Sample title')
> ax.set_ylabel('Sample ylabel')
> ax.set_xlabel('Sample xlabel')
>
> ax.set_xticks(np.arange(0, 10, 20))
> ax.set_xticks(np.arange(0, 10, 5), minor=True)
> ax.set_yticks(np.arange(-1,1,20))
> ax.set_yticks(np.arange(-1,1,20), minor=True)
>
> ax.minorticks_on()
> ax.grid('on')
> plt.show()
>
>
>
>> And if you meant 'grid', I guess
>>
>>  ax.grid('on')
>>
>> should be added.
>>
>> *  Youngung Jeong, 정영웅*
>>
>> On Mon, Jun 1, 2015 at 4:38 PM, Sterling Smith 
>> wrote:
>>
>>> Stephen,
>>>
>>> In your script, you give
>>> ax.minorticks_on
>>> but you need to call that function for anything to occur
>>> ax.minorticks_on()
>>>
>>>
>>> Also, did you see
>>> http://matplotlib.org/examples/pylab_examples/axes_props.html
>>> in case your original question was not answered.
>>>
>>> -Sterling
>>>
>>> On Jun 1, 2015, at 1:24PM, step...@theboulets.net wrote:
>>>
>>> > I only see that you added "plt.show()", but neither the grid or the
>>> axis
>>> > labels are showing up.
>>> >
>>> >> Here is what I see with a couple of things modified ?
>>> >> did you expect something else ?
>>> >>
>>> >> from matplotlib.backends.backend_pdf import PdfPages
>>> >> import matplotlib.pyplot as plt
>>> >> import numpy as np
>>> >>
>>> >> fig = plt.figure()
>>> >> ax = fig.add_subplot(1,1,1)
>>> >>
>>> >> x = np.linspace(0,10,50)
>>> >> y = np.sin(x)
>>> >>
>>> >> with PdfPages('grid_test.pdf') as pdf:
>>> >>plt.clf()
>>> >>
>>> >> plt.clf()
>>> >> plt.plot(x,y)
>>> >> leg = plt.legend(['legend 1'])
>>> >> plt.title('Sample title')
>>> >> ax.set_ylabel('Sample ylabel')
>>> >> ax.set_xlabel('Sample xlabel')
>>> >>
>>> >> ax.set_xticks(np.arange(0, 10, 20))
>>> >> ax.set_xticks(np.arange(0, 10, 5), minor=True)
>>> >> ax.set_yticks(np.arange(-1,1,20))
>>> >> ax.set_yticks(np.arange(-1,1,20), minor=True)
>>> >>
>>> >> ax.minorticks_on
>>> >> plt.show()
>>> >>
>>> >> pdf.savefig()
>>> >>
>>> >>
>>> >> [cid:8C80F2A2-AD50-4E09-B0EF-0596312F5093@ornl.gov]
>>> >>
>>> >>
>>> >>
>>> >> On Jun 1, 2015, at 2:49 PM,
>>> >> mailto:step...@theboulets.net>>
>>> >> wrote:
>>> >>
>>> >> I am having an issue with the grid not appearing that I cannot
>>> figure
>>> out.
>>> >> Can anyone help? Thanks. --StephenB
>>> >>
>>> >> from matplotlib.backends.backend_pdf import PdfPages
>>> >> import matplotlib.pyplot as plt
>>> >> import numpy as np
>>> >>
>>> >> fig = plt.figure()
>>> >> ax = fig.add_subplot(1,1,1)
>>> >>
>>> >> x = np.linspace(0,10,50)
>>> >> y = np.sin(x)
>>> >>
>>> >> with PdfPages('grid_test.pdf') as pdf:
>>> >>   plt.clf()
>>> >>
>>> &

Re: [Matplotlib-users] IMPORTANT: Mailing lists are moving

2015-07-31 Thread Stephen

Hello Micheal,

Do existing matplotlib-users subscribers need to re-subscribe on the new 
list , or have our emails rolled over to the new list?


Steve

On 01/08/15 03:07, Michael Droettboom wrote:


Due to recent technical problems and changes in policy on SourceForge, 
we have decided to move the matplotlib mailing lists to python.org.


To subscribe to the new mailing lists, please visit:

 *

For user questions and support:

https://mail.python.org/mailman/listinfo/matplotlib-users

matplotlib-us...@python.org

 *

For low-volume announcements about matplotlib releases and related
events and software:

https://mail.python.org/mailman/listinfo/matplotlib-announce

matplotlib-annou...@python.org

 *

For developer discussion:

https://mail.python.org/mailman/listinfo/matplotlib-devel

matplotlib-de...@python.org

The old list will remain active in the meantime, but all new posts 
will auto-reply with the location of the new mailing lists.


The old mailing list archives will remain available.

Thanks to Ralf Hildebrandt at python.org for making this possible.

Cheers,
Michael Droettboom

​


--


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


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


[Matplotlib-users] Figure titles and subplot titles

2007-06-21 Thread stephen
I didn't see this in the examples. Can I have a figure title and titles
for subplots too? Can someone post a quick sample? Thanks.

Stephen


-
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


[Matplotlib-users] Setting attributes of a text object

2007-06-21 Thread stephen
I'd like to make a text instance italic, but this doesn't seem to be working:

t = text(15.e3, -70, "25 kHz")
t.set_color('r')
t.set_style('italic')

Stephen


-
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


[Matplotlib-users] Help with title spanning 2x2 subplots

2006-10-06 Thread stephen
I have a 2x2 matrix of subplots. Can I have a title that spans the top?
Thanks.

Stephen


-
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] how to create 2 plots?

2013-08-12 Thread Stephen Gibson

Call   'figure()'   for each plot.

see:  http://matplotlib.org/api/pyplot_api.html

matplotlib.pyplot.figure(/num=None/, /figsize=None/, /dpi=None/, 
/facecolor=None/, /edgecolor=None/, /frameon=True/, /FigureClass='matplotlib.figure.Figure'>/, /**kwargs/)


   Creates a new figure.

   Parameters : 

   *num* : integer or string, optional, default: none

   If not provided, a new figure will be created, and a the figure
   number will be increamted. The figure objects holds this number
   in a number attribute. If num is provided, and a figure with
   this id already exists, make it active, and returns a reference
   to it. If this figure does not exists, create it and returns it.
   If num is a string, the window title will be set to this
   figure's num.



Steve.

--
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[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] Blank plots using plotting submodules

2012-01-03 Thread Stephen Webb
Hello all,

I have a python module that requires making about 24 different kinds of plots, 
and to keep things tidy I put them all in different modules, which I then 
import.

All the import calls are at the head of the top module. There is one plotting 
call inside a while loop, and it is returning blank plots saved in the proper 
location. Blank meaning no axes, so it is a totally empty .png file. After the 
loop, the first plot called is being saved, but all the subsequent plots are 
saving as blank. I begin every plotting module with matplotlib.pyplot.clf() and 
then write out the individual plotting commands.

This worked fine when everything was in one gigantic module, but I am at a loss 
for why it has stopped working once I put everything into submodules.

Thanks for your help,

Stephen D. Webb
Associate Research Scientist
Tech-X Corporation
http://www.txcorp.com

e: sw...@txcorp.com
5621 Arapahoe Ave. Suite A
Boulder, CO 80303 USA

--
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplot3d: add_collection3d: Turn off baseline?

2012-11-19 Thread Stephen Gibson
I want to plot a series of (x,y) datasets similar to the
polygon plot tutorial example (add_collection3d),
but with a transparent facecolor and no baseline.


Setting alpha=0.0 in the tutorial example (below)
achieves the transparency, but the baseline remains.

Is there a way to remove the baseline?

Tks,

Steve.


from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
from matplotlib.colors import colorConverter
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')

cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.0)

xs = np.arange(0, 10, 0.4)
verts = []
zs = [0.0, 1.0, 2.0, 3.0]
for z in zs:
 ys = np.random.rand(len(xs))
 ys[0], ys[-1] = 0, 0
 verts.append(list(zip(xs, ys)))

poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
cc('y')])
#poly.set_alpha(0.7)
ax.add_collection3d(poly, zs=zs, zdir='y')

ax.set_xlabel('X')
ax.set_xlim3d(0, 10)
ax.set_ylabel('Y')
ax.set_ylim3d(-1, 4)
ax.set_zlabel('Z')
ax.set_zlim3d(0, 1)



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplot3d: add_collection3d: Turn off baseline?

2012-11-20 Thread Stephen Gibson

Unfortunately, as you state, "edgecolors='none'"  also wipes the
(x,y) data line.

I tried adding an additional "erase" zero line, with "edgecolors='none'"
for each slice, but it seems the return path extends from
(x[0],y[0])  to (x[-1],y[-1]) via some intermediate point.

An additional blank (x[0], 0.0) to (x[-1], 0.0) does not overlap the 
baseline.


If I can determine the baseline path (coordinates) this procedure
may work.

Thanks, for your input.

Steve.

On 21/11/12 04:04, Benjamin Root wrote:



On Tue, Nov 20, 2012 at 12:55 AM, Stephen Gibson 
mailto:stephen.gib...@anu.edu.au>> wrote:


I want to plot a series of (x,y) datasets similar to the
polygon plot tutorial example (add_collection3d),
but with a transparent facecolor and no baseline.


Setting alpha=0.0 in the tutorial example (below)
achieves the transparency, but the baseline remains.

Is there a way to remove the baseline?

Tks,

Steve.


from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
from matplotlib.colors import colorConverter
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = fig.gca(projection='3d')

cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.0)

xs = np.arange(0, 10, 0.4)
verts = []
zs = [0.0, 1.0, 2.0, 3.0]
for z in zs:
 ys = np.random.rand(len(xs))
 ys[0], ys[-1] = 0, 0
 verts.append(list(zip(xs, ys)))

poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
cc('y')])
#poly.set_alpha(0.7)
ax.add_collection3d(poly, zs=zs, zdir='y')

ax.set_xlabel('X')
ax.set_xlim3d(0, 10)
ax.set_ylabel('Y')
ax.set_ylim3d(-1, 4)
ax.set_zlabel('Z')
ax.set_zlim3d(0, 1)


You should be able to set "edgecolors='none'" or as the same color as 
the facecolors in the constructor for PolyCollection to make it 
disappear.  Unfortunately, that would apply to the entire polygon, and 
not just the part at the base.


Ben Root



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplot3d: add_collection3d: Turn off baseline?

2012-11-20 Thread Stephen Gibson

Setting the y-values of the start and end points to zero, (x[0],0.0) and
(x[-1],0.0), forces the return baseline path to be "well defined" at y=0,
allowing it to be overlain with a second line of a neutral colour.

However, this baseline also wipes a through adjacent slice data.


= FAIL.


Steve.


On 21/11/12 08:38, Stephen Gibson wrote:

Unfortunately, as you state, "edgecolors='none'"  also wipes the
(x,y) data line.

I tried adding an additional "erase" zero line, with "edgecolors='none'"
for each slice, but it seems the return path extends from
(x[0],y[0])  to (x[-1],y[-1]) via some intermediate point.

An additional blank (x[0], 0.0) to (x[-1], 0.0) does not overlap the 
baseline.


If I can determine the baseline path (coordinates) this procedure
may work.

Thanks, for your input.

Steve.

On 21/11/12 04:04, Benjamin Root wrote:



On Tue, Nov 20, 2012 at 12:55 AM, Stephen Gibson 
mailto:stephen.gib...@anu.edu.au>> wrote:


I want to plot a series of (x,y) datasets similar to the
polygon plot tutorial example (add_collection3d),
but with a transparent facecolor and no baseline.


Setting alpha=0.0 in the tutorial example (below)
achieves the transparency, but the baseline remains.

Is there a way to remove the baseline?

Tks,

Steve.


from mpl_toolkits.mplot3d import Axes3D
from matplotlib.collections import PolyCollection
from matplotlib.colors import colorConverter
import matplotlib.pyplot as plt
import numpy as np
[cc('w',1.0),cc('w',1.0)
fig = plt.figure()
ax = fig.gca(projection='3d')

cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.0)

xs = np.arange(0, 10, 0.4)
verts = []
zs = [0.0, 1.0, 2.0, 3.0]
for z in zs:
 ys = np.random.rand(len(xs))
 ys[0], ys[-1] = 0, 0
 verts.append(list(zip(xs, ys)))

poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
cc('y')])
#poly.set_alpha(0.7)
ax.add_collection3d(poly, zs=zs, zdir='y')

ax.set_xlabel('X')
ax.set_xlim3d(0, 10)
ax.set_ylabel('Y')
ax.set_ylim3d(-1, 4)
ax.set_zlabel('Z')
ax.set_zlim3d(0, 1)


You should be able to set "edgecolors='none'" or as the same color as 
the facecolors in the constructor for PolyCollection to make it 
disappear.  Unfortunately, that would apply to the entire polygon, 
and not just the part at the base.


Ben Root





--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov


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


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplot3d: add_collection3d: Turn off baseline?

2012-11-20 Thread Stephen Gibson

Sorry, for the repeated emails/noise.

There is in fact an option "closed=False" for not closing the path:

/class /matplotlib.collections.PolyCollection(/verts/, /sizes=None/, 
/closed=True/, /**kwargs/)


However, "closed=False" has no effect.

Steve.
--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov___
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


[Matplotlib-users] installation of matplotlib on OS X 10.5 with python.org Python 2.6

2010-07-05 Thread Stephen T .

Hi, I am having trouble installing matplotlib. I have OS X 10.5 with Python 2.6
 downloaded and installed from python.org.
 (10.5 came with Apple
 Python 2.5). I've also installed NumPy and SciPy for Python 2.6.
I've
 tried EasyInstall, svn, and dmg. The dmg expects Apple Python 2.6 so 
that's out. For the EasyInstall and svn routes I think I must be missing
 some external libraries? Below are some snippets of warnings/error 
messages:

from EasyInstall:
$ easy_install matplotlib

 
   matplotlib: 0.99.3
warning: no files found matching 
'MANIFEST'
warning: no files found matching 'lib/mpl_toolkits'
ld 
warning: in /opt/local/lib/libfreetype.dylib, file is not of required 
architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of
 required architecture
ld warning: in 
/opt/local/lib/libfreetype.dylib, file is not of required architecture
ld
 warning: in /opt/local/lib/libz.dylib, file is not of required 
architecture
ld warning: in /opt/local/lib/libpng12.dylib, file is 
not of required architecture
ld warning: in 
/opt/local/lib/libz.dylib, file is not of required architecture
ld 
warning: in /opt/local/lib/libfreetype.dylib, file is not of required 
architecture
ld warning: in /opt/local/lib/libz.dylib, file is not of
 required architecture
ld: in /opt/local/lib/libxml2.2.dylib, file is
 not of required architecture for architecture ppc
collect2: ld 
returned 1 exit status
ld
 warning: duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can't 
open input file: 
/var/folders/Yh/Yh3On1j+FXW+r-334Wk-vk+++TI/-Tmp-//ccWD9nm4.out (No such
 file or directory)
error: Setup script exited with error: command 
'c++' failed with exit status 1

from SVN:
$ python setup.py build

matplotlib: 1.0.svn
ld warning: in /opt/local/lib/libfreetype.dylib, 
file is not of required architecture
ld warning: in 
/opt/local/lib/libz.dylib, file is not of required architecture
ld: 
in /opt/local/lib/libxml2.2.dylib, file is not of required architecture 
for architecture ppc
collect2: ld returned 1 exit status
ld 
warning: duplicate dylib /opt/local/lib/libz.1.dylib
lipo: can't open
 input file: 
/var/folders/Yh/Yh3On1j+FXW+r-334Wk-vk+++TI/-Tmp-//cc6cv190.out (No such
 file or directory)
error: command 'c++' failed with exit status 1

and
 in both throughout the messages there are references to "linker input 
file unused because linking not done" for
powerpc-apple-darwin9-gcc-4.0.1
 and i686-apple-darwin9-gcc-4.0.1.

I'd tried the EPD version also
 (and had it working), but then EasyInstall would direct me to their 
repositories (for which I did not have a password) so I could not download and 
install RPy2 and other modules (easily), so I decided to build up 
from individual components...

Any advice you can provide on 
helping me complete the matplotlib installation? I think after this I 
will have the basics for data analysis in Python (with NumPy and SciPy).

Thanks!
Stephen

  
_
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib with psyco

2010-07-14 Thread Stephen Evans
Hi,

While testing Psyco V2 to see if it would offer any speed improvements I 
tried it with some applications using matplotlib. Exceptions were raised 
that were easily resolved by replacing calls to min() and max() with 
their numpy equivalents numpy.amin() and numpy.amax() in the matplotlib 
code.

Simply demonstrated by inserting at the beginning of, say, matplotlib's 
examples/api/barchart_demo.py :

import psyco
psyco.full()

which caused:

Traceback (most recent call last):
   File "barchart_demo.py", line 29, in 
 ax.set_xticks(ind+width)
   File "c:\python26\lib\site-packages\matplotlib\axes.py", line 2064, 
in set_xticks
 return self.xaxis.set_ticks(ticks, minor=minor)
   File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1154, 
in set_ticks
 self.set_view_interval(min(ticks), max(ticks))
   File "c:\python26\lib\site-packages\psyco\builtin.py", line 75, in min
 return _min(*args)
   File "c:\python26\lib\site-packages\psyco\builtin.py", line 34, in _min
 if not iterable:
ValueError: The truth value of an array with more than one element is 
ambiguous. Use a.any() or a.all()


software used:

Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import psyco
 >>> psyco.version_info
(2, 0, 0, 'final', 0)
 >>> import numpy
 >>> numpy.version.version
'1.4.1'
 >>> import matplotlib
 >>> matplotlib.__version__
'0.99.3'


Psyco V2 is available from: http://codespeak.net/svn/psyco/v2/dist/

Should numpy.min()/numpy.amin() be used on array like objects within 
matplotlib, or is min() adequate ? Ditto max().


Stephen Evans

(Out of interest I came across numpy ticket #1286 while looking for this 
issue.)






--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation of matplotlib on OS X 10.5 with python.org Python 2.6

2010-07-14 Thread Stephen T .
 * 
to "import gtk" in your build/install environment   Mac OS X native: yes
Qt: no   Qt4: no Cairo: no
OPTIONAL DATE/TIMEZONE DEPENDENCIES  datetime: present, version 
unknown  dateutil: matplotlib will provide  pytz: 
matplotlib will provideadding pytz
OPTIONAL USETEX DEPENDENCIESdvipng: 1.9   ghostscript: 
8.64 latex: 3.141592   pdftops: 3.02
[...] and then:ld warning: in /opt/local/lib/libfreetype.dylib, file is not of 
required architectureld warning: in /opt/local/lib/libz.dylib, file is not of 
required architectureld: in /opt/local/lib/libxml2.2.dylib, file is not of 
required architecture for architecture ppccollect2: ld returned 1 exit statusld 
warning: duplicate dylib /opt/local/lib/libz.1.dyliblipo: can't open input 
file: /var/folders/Yh/Yh3On1j+FXW+r-334Wk-vk+++TI/-Tmp-//ccUX0Ard.out (No such 
file or directory)error: command 'c++' failed with exit status 1
> > collect2: ld returned 1 exit status
> 
> It doesn't tell which arch it's missing.  I'm a bit confused about
> this "missing architecture".  What arch does your system have?
> 
My architecture is an Intel Core 2 Duo 2 GHz (64-bit). 
> Please be prepared that it may take a while to sort out all the issues
> on our way.  But I'm sure it's worth!

Sorry for my delayed response - I am currently on travel... but I hope this is 
fixable. If nothing else comes to mind, I will try installing Python 2.6 from 
source with the option you mentioned?
Thanks so much!Stephen

  
_
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib with psyco

2010-07-15 Thread Stephen Evans
On 14/07/2010 23:32, Eric Firing wrote:
> On 07/14/2010 11:41 AM, Stephen Evans wrote:
>
>> Hi,
>>
>> While testing Psyco V2 to see if it would offer any speed improvements I
>> tried it with some applications using matplotlib. Exceptions were raised
>> that were easily resolved by replacing calls to min() and max() with
>> their numpy equivalents numpy.amin() and numpy.amax() in the matplotlib
>> code.
>>
>> Simply demonstrated by inserting at the beginning of, say, matplotlib's
>> examples/api/barchart_demo.py :
>>
>> import psyco
>> psyco.full()
>>
>> which caused:
>>
>> Traceback (most recent call last):
>>  File "barchart_demo.py", line 29, in
>>ax.set_xticks(ind+width)
>>  File "c:\python26\lib\site-packages\matplotlib\axes.py", line 2064,
>> in set_xticks
>>return self.xaxis.set_ticks(ticks, minor=minor)
>>  File "c:\python26\lib\site-packages\matplotlib\axis.py", line 1154,
>> in set_ticks
>>self.set_view_interval(min(ticks), max(ticks))
>>  File "c:\python26\lib\site-packages\psyco\builtin.py", line 75, in min
>>return _min(*args)
>>  File "c:\python26\lib\site-packages\psyco\builtin.py", line 34, in _min
>>if not iterable:
>> ValueError: The truth value of an array with more than one element is
>> ambiguous. Use a.any() or a.all()
>>
>>
>> software used:
>>
>> Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit
>> (Intel)] on win32
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>   import psyco
>>>>>   psyco.version_info
>> (2, 0, 0, 'final', 0)
>>>>>   import numpy
>>>>>   numpy.version.version
>> '1.4.1'
>>>>>   import matplotlib
>>>>>   matplotlib.__version__
>> '0.99.3'
>>
>>
>> Psyco V2 is available from: http://codespeak.net/svn/psyco/v2/dist/
>>
>> Should numpy.min()/numpy.amin() be used on array like objects within
>> matplotlib, or is min() adequate ? Ditto max().
>>  
> When short sequences are involved, min() is much faster than amin(). If
> min() is called only a few times per plot in such cases, using the
> slower function would cause a negligible slowdown.  I'm reluctant to
> change mpl to work around a bug in psyco, though.
>
> When you did make the substitution and do the test, was there a big speedup?
>
> Eric
>

For a quick check of any speedup I timed some runs on two plots using 
one of my applications with real world data. 4 runs, average of last 3, 
with some meaningless precision:

a) one subplot of 44000 points
b) two subplots of 1.4M points each

using freshly installed matplotlib 1.0

a) 2.97 seconds
b) 37.85

with psyco and changing min() max() to numpy.amin() numpy.amax() where 
appropriate in matplotlib

a) 3.05
b) 27.48

without psyco, but with the changes above

a) 2.96
b) 37.52

Not a rigorous test, but psyco causes a definite speedup in the larger 
plot. Whether this applies throughout matplotlib on all platforms is 
another matter. Hopefully anyone who is using psyco with 
numpy/matplotlib should be able to patch matplotlib themselves where 
required. If it ain't broke, don't fix it.

Stephen

>> Stephen Evans
>>
>> (Out of interest I came across numpy ticket #1286 while looking for this
>> issue.)
>>
>>
>>
>>
>>
>>
>> --
>> This SF.net email is sponsored by Sprint
>> What will you do first with EVO, the first 4G phone?
>> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>  
>
> --
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>


--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] installation of matplotlib on OS X 10.5 with python.org Python 2.6

2010-08-06 Thread Stephen T .

Hi Friedrich,Thanks again for your response. I've been away traveling (with no 
internet connection) and just returned... hope you can help me troubleshoot 
this last bit (hopefully last bit)!> This is important. I recently had a 
similar issue (sort of). I think> the macports library is 32-bit only, and I 
know that at least for> building Python the build performs 64-bit only by 
default (this was my> issue) on a 64bit system. Of course, in case you want to 
make a 64bit> build against a 32bit library the error would be sensible.> > To 
check this, try to run:> $ file /opt/local/lib/libxml2.2.dylib> > When I run it 
on the Apple supplied file it gives:> > /usr/lib/libxml2.dylib: Mach-O 
universal binary with 3 architectures> /usr/lib/libxml2.dylib (for architecture 
x86_64):Mach-O 64-bit> dynamically linked shared library x86_64> 
/usr/lib/libxml2.dylib (for architecture i386):Mach-O dynamically> 
linked shared library i386> /usr/lib/libxml2.dylib (for architecture ppc7400):  
Mach-O dynamically> linked shared library ppcmine gives 
only:/opt/local/lib/libxml2.2.dylib: Mach-O dynamically linked shared library 
i386Is this the problem?Thanks so much!Stephen
  --
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] 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] installation of matplotlib on OS X 10.5 with python.org Python 2.6

2010-08-17 Thread Stephen T .

Hi Friedrich,
Thanks for your help. Just thought I would follow up to say that it appears to 
be working now. I am not sure what was different this time and last - my libxml 
file still points to the one with the architecture shown below, but I had come 
across this post about changing the targeted architecture called for gcc 
manually:
http://passingcuriosity.com/2009/installing-pil-on-mac-os-x-leopard/
So I had in mind to try this with the matplotlib installation, but for some 
reason the make command did not fail in error this time... as before, I had 
typed in my bash shell:
export PREFIX=~/devmake -f make.osx fetch deps mpl_install
and I am not sure why but those previous error messages never came up. So in 
the end I just included the new matplotlib directory in my python path (in 
.bash_profile):export PYTHONPATH:~/dev/lib/python2.6/site-packages:$PYTHONPATH 
and it appears to be working ok.
So sorry for all the trouble, but thanks for your time!
All the best,Stephen

From: obsessiv...@hotmail.com
To: friedrichromst...@gmail.com
CC: matplotlib-users@lists.sourceforge.net
Subject: RE: [Matplotlib-users] installation of matplotlib on OS X 10.5 with 
python.org Python 2.6
Date: Fri, 6 Aug 2010 13:06:20 -0700








Hi Friedrich,Thanks again for your response. I've been away traveling (with no 
internet connection) and just returned... hope you can help me troubleshoot 
this last bit (hopefully last bit)!> This is important. I recently had a 
similar issue (sort of). I think> the macports library is 32-bit only, and I 
know that at least for> building Python the build performs 64-bit only by 
default (this was my> issue) on a 64bit system. Of course, in case you want to 
make a 64bit> build against a 32bit library the error would be sensible.> > To 
check this, try to run:> $ file /opt/local/lib/libxml2.2.dylib> > When I run it 
on the Apple supplied file it gives:> > /usr/lib/libxml2.dylib: Mach-O 
universal binary with 3 architectures> /usr/lib/libxml2.dylib (for architecture 
x86_64):Mach-O 64-bit> dynamically linked shared library x86_64> 
/usr/lib/libxml2.dylib (for architecture i386):Mach-O dynamically> 
linked shared library i386> /usr/lib/libxml2.dylib (for architecture ppc7400):  
Mach-O dynamically> linked shared library ppcmine gives 
only:/opt/local/lib/libxml2.2.dylib: Mach-O dynamically linked shared library 
i386Is this the problem?Thanks so much!Stephen
  --
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


Re: [Matplotlib-users] plotting tab and comma delimited file (LTSpice waveform export)

2010-12-04 Thread Stephen Evans
On 04/12/2010 02:34, K. Larsen wrote:
> The LTSpice circuit simulation program outputs a file that looks like this:
>
> Freq.   V(n003) V(n005) V(n007)
> 1.0e+000(-1.68072e+002dB,1.79085e+002°)
> (-1.71453e-006dB,-3.6e-002°)(-8.40364e+001dB,8.99964e+001°)
> 1.07177e+000(-1.66868e+002dB,1.79145e+002°)
> (-1.96947e-006dB,-3.85838e-002°)(-8.34343e+001dB,8.99961e+001°)
> 1.14870e+000(-1.65664e+002dB,1.79202e+002°)
> (-2.26233e-006dB,-4.13531e-002°)(-8.28323e+001dB,8.99959e+001°)
> ...
>
> As can be seen there are 4 tab-delimited columns. The first column is
> the dependent (horizontal) axis and represents Frequency.  The
> following 3 columns each contain 2 comma-delimited data points
> including their units. These are the magnitude expressed in decibels
> and the phase expressed in degrees.
>
> I'd like to be able to plot this file.  6 separate plots should
> result, or 3 pairs of 2 waveforms that share the same plot yet have 2
> different axes.  What is the best method to accomplish this?
The matplotlib examples api/two_scales.py & 
pylab_examples/shared_axis_demo.py may be what you require to display 
your data. Though I must admit to not having tried both at the same time :)

For extracting data my personal preference is to use the csv module with 
generators and regular expressions - keeping results in namedtuples. 
Quickly written example for your data:

# -*- mode: python tab-width: 4 coding: utf-8 -*-
# tested with Python 2.6
from future_builtins import map

import csv
import re
from collections import deque, namedtuple
import numpy as np

RowTuple = namedtuple('RowTuple', 'freq col1 col2 col3')
ColumnTuple = namedtuple('ColumnTuple', 'magnitude phase')
DequeTuple = namedtuple('DequeTuple', 'freq magnitude1 phase1 magnitude2 
phase2 magnitude3 phase3')

def readLTSpice(filename):
 # try codec.open() if not ascii
 with open(filename, 'rb') as fp:
 fp.next() # discard the first row
 for row in csv.reader(fp, delimiter='\t'):
 yield RowTuple(*row)

def splitColumn(col):
 # use a regular expression to extract floating point number
 # n.b. regular expressions are cached by the re module
 exp = re.compile(r"[+-]? *(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?")
 return ColumnTuple(*map(float, exp.findall(col)))

def processFile(filename):
 rows = readLTSpice(filename)
 rows = (RowTuple(row.freq, splitColumn(row.col1), 
splitColumn(row.col2), splitColumn(row.col3)) for row in rows)

 # if there is a large number of points then deque() is more efficient
 # than lists as there is no copying when more memory is required
 result = DequeTuple(deque(), deque(), deque(), deque(), deque(), 
deque(), deque())

 for row in rows:
 result.freq.append(row.freq)
 result.magnitude1.append(row.col1.magnitude)
 result.magnitude2.append(row.col2.magnitude)
 result.magnitude3.append(row.col3.magnitude)
 result.phase1.append(row.col1.phase)
 result.phase2.append(row.col2.phase)
 result.phase3.append(row.col3.phase)

 return result

processed = processFile('ltspice.data')

# convert to numpy arrays for use with matplotlib
freq = np.asarray(processed.freq)
magnitude1 = np.asarray(processed.magnitude1)
magnitude2 = np.asarray(processed.magnitude2)
magnitude3 = np.asarray(processed.magnitude3)
phase1 = np.asarray(processed.phase1)
phase2 = np.asarray(processed.phase2)
phase3 = np.asarray(processed.phase3)

# ready for plotting...



Stephen Evans


--
What happens now with your Lotus Notes apps - do you make another costly 
upgrade, or settle for being marooned without product support? Time to move
off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
use, and manage than apps on traditional platforms. Sign up for the Lotus 
Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
___
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] matplotlib can't find pygtk during build

2007-02-03 Thread Stephen Uhlhorn
I'm trying to build matplotlib with the GTK/GTKAgg backends but it
won't find my copy of pygtk:

mrhanky:/usr/local/src/matplotlib-0.87.7 uley$ sudo python setup.py build
GTK requires pygtk
GTKAgg requires pygtk
running build
running build_py
creating build
...

I followed the python/numpy/scipy installation method here:
http://projects.scipy.org/pipermail/numpy-discussion/2007-January/025368.html

I installed pygtk (2.10.3) with mac/darwinports on my mac os 10.4
ppcmachine. I edited setupext.py to look for all the libs under
/opt/local. matplotlib seems to find libjpeg, libpng, et al, but it
can't find pygtk. How can I modify matplotlib, or  how should I
install pygtk so the it builds correctly?

Thanks-
-stephen

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


[Matplotlib-users] Fwd: matplotlib can't find pygtk during build

2007-02-05 Thread Stephen Uhlhorn
Sorry for the forward... I wanted to make sure this made it to the list.

-- Forwarded message --
From: Stephen Uhlhorn <[EMAIL PROTECTED]>
Date: Feb 4, 2007 8:02 AM
Subject: Re: [Matplotlib-users] matplotlib can't find pygtk during build
To: Christopher Barker <[EMAIL PROTECTED]>


On 2/3/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
> I'm pretty sure that MPL looks for it by trying to import it. does:
>
> import pygtk
>
> work with the version of Python you're using?
>
> > I followed the python/numpy/scipy installation method here:
> > http://projects.scipy.org/pipermail/numpy-discussion/2007-January/025368.html
>
> Those instructions are for the Universal Framework Python, that you can
> get from python.org and pythonmac.org/packages. That version does not
> play so well with Darwinports.
>
> > I installed pygtk (2.10.3) with mac/darwinports on my mac os 10.4
> > ppcmachine.
>
> Are you using a darwinports python? that version of pygtk will probably
> only work with a darwinports python, and in that case, there may even be
> a darwinports matplotlib.

import pygtk barfs. My python is from ActiveState (Framework) which
was recommended by the scipy people.

> In general, you need to use all darwinports python stuff or no
> darwinports python stuff.
>
> In theory, one could use PyGTK with he Framework build of python, using
> Apple's X11, but I've never seen a package for that.
>
> Why do you want to use pygtk on a Mac? why not TK or wx, or even try the
> cocoa back-end, though I have no idea what state that is in.

Here's the real saga. I had a working Fink installaiton of
python/numpy/scipy/matplotlib until an update to scipy broke critical
functions (fopen). The fix is in cvs, so this whole mess started in an
attempt to use a cvs version of scipy. So I followed the instructions
on the scipy site and in the link above. Python numpy, and scipy are
fine, but I can't get matplotlib to work with the system.

I tried wxpython2.6 first, but figure windows never got drawn on my
display, even when I used pythonw. So I tried pygtk because it worked
fine for me under fink and on my linux box. I thought I could build a
binary pygtk with darwinports and use it in my installation... I guess
not.

So here we are. What to do? I think these are my options:

1) Build a mpkg of pygtk using darwinports and install it under my
python. Is this possible?

2) Get wx working somehow. Where do I begin?

3) Cocoa backend? I didn't know there was one.

4) Go back to fink or darwinports  and fight these problems on the scipy side.

Which course do you (or anyone) recommend?

Thanks-
-stephen

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


Re: [Matplotlib-users] matplotlib can't find pygtk during build

2007-02-05 Thread Stephen Uhlhorn
Hmm... After the long discussion I'm trying to decide what the best
route is. If what I want is simply a stable scipy/matplotlib
installation (OS X), what is the best (most stable and predictable)
method?

BTW- What is wrong with the ActiveState python installation? It was
recommended on the scipy site.

-stephen

On 2/5/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
> Stephen:
>
> Russell E Owen wrote:
> > It's up. Bob Ippolito put it up shortly after he got back from vacation.
>
> So this should work, with the Python, numpy, wxPython2.6.3 that are also
> there:
>
> http://pythonmac.org/packages/py24-fat/index.html
>
> -Chris

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


[Matplotlib-users] wx figure window hangs w/macpython

2007-02-06 Thread Stephen Uhlhorn
I installed the pythonmac packages from
http://pythonmac.org/packages/py24-fat/index.html :

python2.4
wxpython2.6
numpy1.0.1
matplotlib-0.87.7

I called python with 'pythonw' and figure() draws a new figure window,
but it hangs.

Here are the relevant lines from my matplotlibrc file:

 CONFIGURATION BEGINS HERE ---
backend  : WXAgg
numerix  : numpy  # numpy, Numeric or numarray
interactive  : True  # see
http://matplotlib.sourceforge.net/interactive.html
#toolbar  : toolbar2   # None | classic | toolbar2
#timezone : UTC# a pytz timezone string, eg US/Central or
Europe/Paris
#datapath : /home/jdhunter/mpldata

Is this a misconfigured rc file? Or, should I be using ipython to
handle the gui stuff?

If I use ipython, what's the best way to install? From source? Python egg?

Thanks
-stephen

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


Re: [Matplotlib-users] wx figure window hangs w/macpython

2007-02-06 Thread Stephen Uhlhorn
Thanks. Ipython worked like a charm. Are there any plans of putting
ipython up with the other macpython packages? It seems like it's a
pretty important piece of the mac/mpl puzzle.

-stephen

On 2/6/07, George Nurser <[EMAIL PROTECTED]> wrote:
>
> I had the same problem. Either you need to use TkAgg backend, or use ipython.
>
> making it from source is easy.
>
> Get ipython-0.7.3.tar.gz  from http://ipython.scipy.org/dist/
>
> Expand it
>
> cd .../ipython-0.7.3
> sudo python setup.py install
>
> This puts executables into 
> /Library/Frameworks/Python.framework/Versions/2.4/bin
>
> You need to make sure they are in your path either by adding
> /Library/Frameworks/Python.framework/Versions/2.4/bin to your path, or
> making symbolic links to a directory in your path.
> e.g. I did
> cd /usr/local/bin/
> sudo ln -s /Library/Frameworks/Python.framework/Versions/2.4/bin/ipython .
> sudo ln -s /Library/Frameworks/Python.framework/Versions/2.4/bin/irunner  .
> sudo ln -s /Library/Frameworks/Python.framework/Versions/2.4/bin/pycolor  .
> rehash
>
> HTH. George Nurser.

-
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@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

Re: [Matplotlib-users] problems building/installing

2007-04-10 Thread Stephen Uhlhorn
Hello Simon-

I have experimented with every conceivable python/numpy/mpl
permutation on mac os and I will second Chris Barker's recommendation.
Use the pythonmac.org packages with the wx backend. Choose whichever
version of wx and python that is best supported my the mpl version.

I use mpl v 0.87, wx 2.6. and python 2.4 on my ppc mac.

-stephen

On 4/5/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
> Simson Garfinkel wrote:
> > I'm embarrassed to ask that I'm having trouble building/installing
> > matplotlib on an intel Mac.
>
> Don't be embarassed -- it's really pretty hard!
>
> All the various pythons (Universal, fink, darwinports, etc) for OS-X
> confuse things a lot, but I think you'll get the best support if you
> stick with the "official" framework Universal build:
>
> http://www.python.org/download/
>
> You can also get it from:
>
> http://www.pythonmac.org/packages/py25-fat/index.html
>
> The cool thing about that site is that you can get a bunch of pr-built
> compatible packages from there also.
>
> Unfortunately, the matplotlib there right now doesn't appear to work
> with the latest wxPython. I'm not sure which wxPython version it is
> built against, but it crashed for me when used with wxPython2.8.3
>
> The good news is, as I understand it, is the Ken McIvor patched the most
> recent MPL to use wxPython 2.8b features that allow you to build MPL
> without linking to wxPython.
>
> Hopefully someone will do a build that works with wxPython2.8.3 and put
> it up on the pythonmac site soon. I may even do it, but I haven't needed
> to for a while, so I don't have it all set up at this point.
>
> If you're going to built it yourself, still use the pythonmac packages
> for everything else, you'll be glad you did.
>
> -Chris
>
> -
> 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
>

-
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] Matplotlib 0.90.0 on OS-X with wxPython2.8.3

2007-04-12 Thread Stephen Uhlhorn
Do I need to manually remove _wxagg.so in order to use the new packages?

Thanks Chris!
-stephen

On 4/11/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've got the MPL 0.90.0 installer on pythonmac working OK with:
>
> Python2.5
> wxPython2.8.3
>
> I accomplished this by removing:
>
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/backends/_wxagg.so
>
> Which disables the accelerator that doesn't work with wxPython 2.8
>
> What we really need to do is get Ken's changes into a release, but I
> have my immediate needs met.
>
> -Chris
>
>
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R(206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> [EMAIL PROTECTED]
>
> -
> 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
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

-
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
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 0.90.0 on OS-X with wxPython2.8.3

2007-04-12 Thread Stephen Uhlhorn
Just to be clear, the installation order is:

1) install python2.5 from macpython.
2) remove wxagg.so
3) install wxpython frim macpython
4) install numpy/mpl from macpython

Correct?
-stephen

On 4/12/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
> Stephen Uhlhorn wrote:
> > Do I need to manually remove _wxagg.so in order to use the new packages?
>
> if you want to use them with wxPython 2.8.*, yes.
>
> They *should* work with 2.6.*, with _wxagg.so, but I haven't tested
> that. This should all be better with the next release.
>
> -Chris
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R(206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> [EMAIL PROTECTED]
>

-
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
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 0.90.0 on OS-X with wxPython2.8.3

2007-04-13 Thread Stephen Uhlhorn
One more question:

What impact does disabling the "accelerator" have? Will this slow down
plotting in some situations?

-stephen

On 4/12/07, Christopher Barker <[EMAIL PROTECTED]> wrote:
> Stephen Uhlhorn wrote:
> > Just to be clear, the installation order is:
> >
> > 1) install python2.5 from macpython.
> > 2) remove wxagg.so
> > 3) install wxpython frim macpython
> > 4) install numpy/mpl from macpython
>
> that's out of order. wxagg.so is part of mpl, so:
>
> 1) install python2.5 from macpython.
> 2) install wxpython frim macpython
> 3) install numpy/mpl from macpython
> 4) remove wxagg.so
>
> -Chris
>
>
> --
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R(206) 526-6959   voice
> 7600 Sand Point Way NE   (206) 526-6329   fax
> Seattle, WA  98115   (206) 526-6317   main reception
>
> [EMAIL PROTECTED]
>

-
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
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] help with fonts in legends

2007-04-22 Thread Stephen Boulet
I wanted to use this code to set the label font in my legends:

from pylab.font_manager import fontManager, FontProperties
font = FontProperties(size='x-small')
legend(legends,prop=font)

but I'm getting "ImportError: No module named font_manager".

Can someone help me set legend size? Thanks.

Stephen

-
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


[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


[Matplotlib-users] eggs or pythonmac packages on OS X?

2007-12-04 Thread Stephen Uhlhorn
I'm running MacPython 2.5 on Mac OS 10.5.1 and would like to update
matplotlib to 0.91.1. Im using mpl 0.90.1 from the pythonmac site now.
Is it better for me to wait till a pythonmac package is availabel or
are the eggs on SF good to use. I would favor the SF eggs because of
ease of upgrading unless there are some OS X conflicts I'm unaware of.

If I use the eggs, what's the best way to safely uninstall the
pythonmac package? Just delete the relevant site-packages durectory?

Thanks-
-stephen

-
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] matplotlib ignores CocoAff backend preference

2007-12-04 Thread Stephen Uhlhorn
I just started playing with the CocoaAgg backend in mpl 0.90.1
w/pyobjc 1.4 and matplotlib uses the 'backend' line in the rc file
just fine. However, it doesn't seem to work well in interactive mode
using ipython 0.8.1 (control is not returned to the shell after
plotting).

-stephen

On Dec 4, 2007 1:49 PM, Chris Fonnesbeck <[EMAIL PROTECTED]> wrote:
> I have the CocoaAgg backend specified in matplotlibrc in ~/.matplotlib/ as:
>
> backend  : CocoaAgg
>
> However, when I plot, matplotlib uses the TkAgg backend in spite of this.
>
> --
> Christopher J. Fonnesbeck
> + Fish & Wildlife Research Institute (FWC)
> + 727.235.5570
>
> -
> 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
>

-
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


[Matplotlib-users] CocoaAgg backend status?

2007-12-05 Thread Stephen Uhlhorn
I was just wondering what the status of the CocoaAgg backend is since
there is not much info available.

Can it be used interactively w/ipython?

Can it be used to embed mpl in a cocoa app and take advantage of all
the xcode/interface builder stuff in OS X?

Thanks-
-stephen

-
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] eggs or pythonmac packages on OS X?

2007-12-05 Thread Stephen Uhlhorn
On Dec 4, 2007 5:14 PM, Russell E. Owen <[EMAIL PROTECTED]> wrote:

> If you use Tcl/Tk and use a current version (instead of the ancient
> version that is built in) then use the packages at pythonmac. I just
> built 0.91.1 today and it should show up there soon. Meanwhile you can
> get it from here:
> <http://www.astro.washington.edu/rowen/pythoninstallers/>
>
> I hope that someday the official Mac egg version will work with 3rd
> party Tcl/Tk but no version I've tried has -- including 0.91.1.

Does this mean that the only difference between the egg and pythonmac
version is how it's linked against Tcl/Tk?

Just for my edification, why can't the egg version be linked
against/include a different Tcl/Tk?

Thanks-
-stephen

-
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] CocoaAgg backend status?

2007-12-05 Thread Stephen Uhlhorn
Thanks for the background Barry.

I was asking because I have a bit of image processing/analysis code
(numpy/mpl/pil) that I would like to build a GUI front-end for. As I
am a recent convert to the osx world, I thought it would be very slick
to be able to do this with the xcode/IB tools. Since this is not
high-priority work right now, I'll stick with wx for now. I will be
interested to see how your Quartz backend comes along.

-
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


Re: [Matplotlib-users] Legend outside plot

2006-08-18 Thread Stephen Walton
I too would like a simple "Reply" to go to the list.  I had to use Gmail's "Reply to all" feature to put this on the list.
-
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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib version info

2006-10-30 Thread Stephen Uhlhorn
Sorry if this has been answered already, but I'm having trouble
finding the answer--

What version of matplotlib is compatible with numpy 1.0 (final)? Or,
should I continue to use numpy-1.0rc2 w/ mpl 0.87.7? I'm building from
source on mac os using fink, and have had no trouble until numpy
1.0rc3 came out.

-stephen

-
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@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


[Matplotlib-users] Basemap with origin within the plot

2007-10-11 Thread Pascoe, S (Stephen)

I am trying to prepare a plot on the UK national grid.  This is a transverse 
mercator projection centred on the UK with a false origin offset from the 
projection origin (lat_0, lon_0).

The Basemap coordinate system origin (0 Easting and Northing) always seems to 
be set in the lower-left corner of the plot.  The plot I need includes data 
either side of the origin so I need the origin within the plot area.

Is there a general way of setting the origin somewhere other than the 
lower-left corner?

I can either get basemap to plot the correct data region, in which case the 
origin is in the wrong place or I can fool Basemap by adjusting the axes bounds 
later.  However, if I do this some of the coastline isn't plotted because 
Basemap decides it isn't on the map.

Cheers,
Stephen.



-
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