Re: [Matplotlib-users] Custom ticklabels on colorbar

2009-08-20 Thread Scott Sinclair
> 2009/8/20 Daniel Platz :
> The setting of the new ticklabels works now. But the first label is
> attached to the second tick. I tried to adapt the clim range by using
> the vmin and vmax option of pcolor but it did not help.

Does this help?

http://matplotlib.sourceforge.net/examples/pylab_examples/colorbar_tick_labelling_demo.html

Cheers,
Scott

> Jouni K. Seppänen wrote:
>> Daniel Platz  writes:
>>
>>> t = cb4.ax.get_xticklabels()
>>>     for j in t:
>>>         j.set_text(r'$\pi$')
>>>         j.set_fontsize(10)
>>>         j.set_family('serif')
>>
>> Try cb4.ax.set_xticklabels([r'$-\pi$', ...]); draw()
>>
>>> Another problem is that I want to adjust the fontsize of the colorbar
>>> ticklabels on four subplots. This only works for the last two subplots
>>> with the syntax shown above. The same syntax has no effect on the first
>>> two subplots.
>>
>> You should be able to pass font properties to set_xticklabels. If that
>> doesn't work, please post a complete example.

--
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] TikZ/PGF backend

2009-08-20 Thread jason-sage
Justin Findlay wrote:
> I'm trying to find a way to embed matplotlib graphs in LaTeX
> documents.  Ideally a solution would involve converting MPL's output
> to TikZ in order to get native rendering of the graphics and text.
> This seems like the "Right Way" to go, unfortunately, my classes start
> on Monday, and I'm neither python nor TeX guru enough to begin a
> project so ambitious and important.  This is what I have done so far,
> benevolent user that I am,
>
> https://sourceforge.net/tracker/?func=detail&aid=2841217&group_id=80706&atid=560723
>
> If anyone has more information on this or code to this effect I would
> be very interested in learning/contributing.
>   

Last year I spent an evening trying to modify the ps or pdf backends to 
be a PGF/TIKZ backend.  I wasn't very successful, but I was also trying 
to learn the system too.  It seems like it would be easy to implement 
the few primitives in PGF instead of postscript, since the models are 
pretty similar, from what I recall.  I haven't spent the time to revisit 
it, though, and it probably won't make it back to the top of my list for 
a while.

For those trying to pursue this, the PGF documentation is handy: 
http://www.ctan.org/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf 


See p. 439 and p. 461 for commands for drawing paths with the "basic" 
layer, for example.


Jason

-- 
Jason Grout

--
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] TikZ/PGF backend

2009-08-20 Thread Justin Findlay
On Thu, Aug 20, 2009 at 3:56 PM, John Hunter wrote:
> What's wrong with including the ps/eps output in your latex docs, or
> the pdf output for your pdflatex docs?  That's what most people do.
> You can enable the "usetex" option if you want tex to render the text

The difference is subtle.  By having the graphics and text rendered by
the different system they will end up having a different 'look'.  I
know that usetex solves most of the text-in-graphics issues, and that
TeX wasn't even designed to really layout anything but text and the
most minimal vector graphics, but TikZ is more than adequate for plots
and stands on its own merit as a fully-featured graphics language.
TeX+TikZ finally eliminates the need for external vector hackery.  Of
course, I'll probably just use pdf and usetex as you suggest, but I
was hoping for something better.


Justin

(stupid gmail reply to defaults)

--
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] TikZ/PGF backend

2009-08-20 Thread John Hunter
On Thu, Aug 20, 2009 at 4:08 PM, Justin Findlay wrote:
> I'm trying to find a way to embed matplotlib graphs in LaTeX
> documents.  Ideally a solution would involve converting MPL's output
> to TikZ in order to get native rendering of the graphics and text.
> This seems like the "Right Way" to go, unfortunately, my classes start
> on Monday, and I'm neither python nor TeX guru enough to begin a
> project so ambitious and important.  This is what I have done so far,
> benevolent user that I am,

What's wrong with including the ps/eps output in your latex docs, or
the pdf output for your pdflatex docs?  That's what most people do.
You can enable the "usetex" option if you want tex to render the text

http://matplotlib.sourceforge.net/users/usetex.html

JDH

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


[Matplotlib-users] TikZ/PGF backend

2009-08-20 Thread Justin Findlay
I'm trying to find a way to embed matplotlib graphs in LaTeX
documents.  Ideally a solution would involve converting MPL's output
to TikZ in order to get native rendering of the graphics and text.
This seems like the "Right Way" to go, unfortunately, my classes start
on Monday, and I'm neither python nor TeX guru enough to begin a
project so ambitious and important.  This is what I have done so far,
benevolent user that I am,

https://sourceforge.net/tracker/?func=detail&aid=2841217&group_id=80706&atid=560723

If anyone has more information on this or code to this effect I would
be very interested in learning/contributing.


Justin

--
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] Custom ticklabels on colorbar

2009-08-20 Thread Daniel Platz
The setting of the new ticklabels works now. But the first label is 
attached to the second tick. I tried to adapt the clim range by using 
the vmin and vmax option of pcolor but it did not help.

I also still have the problem that the changes are only performed on the 
last two subplots (in one loop run). The code of the plotting loop is:
for i in range(len(fname)):
 # Load data from file
 data1_amp = np.loadtxt(fname[4*i])
 data1_phase = np.loadtxt(fname[4*i+1])
 data2_amp = np.loadtxt(fname[4*i+2])
 data2_phase = np.loadtxt(fname[4*i+3])

 # Display data using pcolor
 ax1 = fig1.add_subplot(len(fname)/4,4,4*i+1)
 pc1 = ax1.pcolorfast(data1_amp,cmap=mpl.cm.Oranges)
 ax1.set_xlim((0,250))
 ax1.set_ylim((0,256))
 ax1.set_xticklabels('')
 ax1.set_yticklabels('')
 cb1 = fig1.colorbar(pc1,ax=ax1,orientation='horizontal',pad=0.00)
 cb1.ax.set_xticklabels(range(5),fontsize=10)

 ax2 = fig1.add_subplot(len(fname)/4,4,4*i+2)
 pc2 = ax2.pcolorfast(data1_phase,cmap=nat_per)
 ax2.set_xlim((0,250))
 ax2.set_ylim((0,256))
 ax2.set_xticklabels('')
 ax2.set_yticklabels('')
 cb2 = fig1.colorbar(pc2,ax=ax2,orientation='horizontal',pad=0.00, 
   ticks=[-np.pi,-np.pi/2,0,np.pi/2,np.pi])
 cb2.ax.set_xticklabels(range(5),fontsize=10)

 ax3 = fig1.add_subplot(len(fname)/4,4,4*i+3)
 pc3 = ax3.pcolorfast(data2_amp,cmap=mpl.cm.Oranges)
 ax3.set_xlim((0,250))
 ax3.set_ylim((0,256))
 ax3.set_xticklabels('')
 ax3.set_yticklabels('')
 cb3 = fig1.colorbar(pc1,ax=ax3,orientation='horizontal',pad=0.00)
 cb3.ax.set_xticklabels(range(5),fontsize=10)

 ax4 = fig1.add_subplot(len(fname)/4,4,4*i+4)
 pc4 = 
ax4.pcolorfast(data2_phase,cmap=nat_per,vmin=-np.pi-0.1,vmax=np.pi+0.001)
 ax4.set_xlim((0,250))
 ax4.set_ylim((0,256))
 ax4.set_xticklabels('')
 ax4.set_yticklabels('')
 cb4 = fig1.colorbar(pc2,ax=ax4,orientation='horizontal',pad=0.00, 
ticks=[-np.pi, -np.pi/2, 0.0, np.pi/2, np.pi])
 cb4.ax.set_xticklabels([r'$-\pi$', r'$-\frac{\pi}{2}$', r'$0$', 
r'$\frac{\pi}{2}$', r'$\pi$'],fontsize=10)




Daniel


Jouni K. Seppänen wrote:
> Daniel Platz  writes:
> 
>> t = cb4.ax.get_xticklabels()
>> for j in t:
>> j.set_text(r'$\pi$')
>> j.set_fontsize(10)
>> j.set_family('serif')
> 
> Try cb4.ax.set_xticklabels([r'$-\pi$', ...]); draw()
> 
>> Another problem is that I want to adjust the fontsize of the colorbar 
>> ticklabels on four subplots. This only works for the last two subplots 
>> with the syntax shown above. The same syntax has no effect on the first 
>> two subplots.
> 
> You should be able to pass font properties to set_xticklabels. If that
> doesn't work, please post a complete example.
> 


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


[Matplotlib-users] FW: pylab datapath problem using WXAgg under SPE

2009-08-20 Thread Dylan Walker
Hey everyone,

 

I cannot seem to get pylab to display a plot using WXAgg.  For some reason,
the datapath that I set in my matplotlibrc and confirmed by checking
rcParams['datapath'] is not being passed correctly to wx.  Instead, it
attempts to find the data (button images like subplots.png, etc.) in the
directory from which I called my IDE (Stani's Python Editor), which does
have an ' ./images/' subdirectory if that is at all relevant?  Any ideas?  I
tried searching the mailing list archives (is there a good way to actually
_search them_ ??), but couldn't find anyone with the same problem.  

 

 

Dylan Walker

 

--
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] Custom ticklabels on colorbar

2009-08-20 Thread Jouni K . Seppänen
Daniel Platz  writes:

> t = cb4.ax.get_xticklabels()
> for j in t:
> j.set_text(r'$\pi$')
> j.set_fontsize(10)
> j.set_family('serif')

Try cb4.ax.set_xticklabels([r'$-\pi$', ...]); draw()

> Another problem is that I want to adjust the fontsize of the colorbar 
> ticklabels on four subplots. This only works for the last two subplots 
> with the syntax shown above. The same syntax has no effect on the first 
> two subplots.

You should be able to pass font properties to set_xticklabels. If that
doesn't work, please post a complete example.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


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


[Matplotlib-users] Custom ticklabels on colorbar

2009-08-20 Thread Daniel Platz
Hello,

I would like to have some custom ticklabels on a colorbar. In detail, I 
want the four labels '-\pi', -\pi/2', '0', \pi/2', \pi'. I tried to set 
manually each text object obtained from cb.ax.get_xticklabels():

t = cb4.ax.get_xticklabels()
for j in t:
j.set_text(r'$\pi$')
j.set_fontsize(10)
j.set_family('serif')

However, no matter what I set for text, it has no effect on the 
displayed figure.

Another problem is that I want to adjust the fontsize of the colorbar 
ticklabels on four subplots. This only works for the last two subplots 
with the syntax shown above. The same syntax has no effect on the first 
two subplots.

If anybody has some ideas I would be really gald about an answer.

Thanks in advance

Daniel

--
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] horizontal grid lines appearing when i put text on a plot

2009-08-20 Thread Ryan May
On Thu, Aug 20, 2009 at 11:00 AM, DEMOLISHOR! the Demolishor <
destrooo...@gmail.com> wrote:

> Hello all,
>   I suppose this is a newbie question, but why do I get these three
> horizontal grid lines when I add text to my plot? I've tried repeating the
> call to pyplot.grid() but that doesn't affect anything...
>
> #!/usr/bin/env python
>
> from matplotlib import pyplot
> from scipy import randn
>
> mu, sigma = 200, 25
> x = mu + sigma*randn(1)
>
> pyplot.grid(False)
> n, bins, patches = pyplot.hist(x, 50, normed=1, histtype='stepfilled')
>
> xlim_right = pyplot.xlim()[1]
> ylim_top   = pyplot.ylim()[1]
>
> pyplot.text(xlim_right*0.8, ylim_top*0.9, 'Fit Parameters:', weight='bold',
> size='large')
>
> pyplot.show()
>
> #end script
>
> My matplotlib version is:
>
> [cra...@fsul1 matplotlib]$ python
> Python 2.6.2 (r262:71600, Jul 28 2009, 10:47:31)
> [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import matplotlib
> >>> matplotlib.__version__
> '0.98.5.2'
> >>>


I can't reproduce this with SVN head here.   I don't see anything in your
script that should cause this.  Can you upgrade to the latest release, 0.99?

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from Pasadena, California, United States
--
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


[Matplotlib-users] horizontal grid lines appearing when i put text on a plot

2009-08-20 Thread DEMOLISHOR! the Demolishor
Hello all,
  I suppose this is a newbie question, but why do I get these three
horizontal grid lines when I add text to my plot? I've tried repeating the
call to pyplot.grid() but that doesn't affect anything...

#!/usr/bin/env python

from matplotlib import pyplot
from scipy import randn

mu, sigma = 200, 25
x = mu + sigma*randn(1)

pyplot.grid(False)
n, bins, patches = pyplot.hist(x, 50, normed=1, histtype='stepfilled')

xlim_right = pyplot.xlim()[1]
ylim_top   = pyplot.ylim()[1]

pyplot.text(xlim_right*0.8, ylim_top*0.9, 'Fit Parameters:', weight='bold',
size='large')

pyplot.show()

#end script

My matplotlib version is:

[cra...@fsul1 matplotlib]$ python
Python 2.6.2 (r262:71600, Jul 28 2009, 10:47:31)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import matplotlib
>>> matplotlib.__version__
'0.98.5.2'
>>>


Thanks in advance!
<>--
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] plot multiple times in one script fails

2009-08-20 Thread M. Hecht

Hi,

ok meanwhile I found out that this is a typical beginners error, sorry.

Nevertheless, using ion(), and ioff() together with draw() works fine.

What I didn't find out up to now was the funtion

   ginput(n=1, timeout=30, show_clicks=True)

which prevents me from killing the window after every plot, so
thank you John Hunter-4. Before it was even not possible to 
move the focus to another window without crashing the application.

Now all behaves as "expected".

Thank you again.


John Hunter-4 wrote:
> 
> On Tue, Aug 18, 2009 at 3:55 AM, M. Hecht
> wrote:
>> The first figure is drawn without problems but after closing it (by
>> clicking
>> the cross in the upper
>> right corner of the window) the second figure cannot be plot anymore.
>> What I
>> wanted to do was
>> to visualize all selected files of a directory one after the other. To do
>> this I want to close the old
>> figure and then the new figure should com up as long as there is a file
>> to
>> visualize left. Unfortunaltely
>> only the first figure is shown as in the simple example.
>> So, what's wrong
> 
> We don't really have support for blocking input where a program is
> halted until you close the open figure, and then the next one loads.
> You could write something using event handling, where on a key press
> event the next figure was loaded.  You may also be able to use ginput
> here, which will give you a blocking input function.
> 
> See
> 
> http://matplotlib.sourceforge.net/users/shell.html
> 
> http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.ginput
> 
> http://matplotlib.sourceforge.net/users/event_handling.html
> 
> http://matplotlib.sourceforge.net/examples/pylab_examples/ginput_demo.html
> 
> --
> 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
> 
> 

-- 
View this message in context: 
http://www.nabble.com/plot-multiple-times-in-one-script-fails-tp25020909p25064644.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
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] mac os backend not building

2009-08-20 Thread John Hunter
On Thu, Aug 20, 2009 at 9:56 AM, George Nurser wrote:
> Michiel,
> I'm on Mac OS X 10.5. My version of Python is 2.5.2, also from python.org.
> Presumably the new matplotlib does compile with 2.6.2 on 10.5?

It does -- I compiled the mpl OSX binaries using python 2.6.2 (from
src) from python.org on 10.5.6 with gcc 4.0.1

--
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] mac os backend not building

2009-08-20 Thread George Nurser
Michiel,
I'm on Mac OS X 10.5. My version of Python is 2.5.2, also from python.org.
Presumably the new matplotlib does compile with 2.6.2 on 10.5?

I'm a bit reluctant to install 2.6.2 now, since we'll be moving to
10.6 ASAP here for the Exchange compatibility, and I guess I'll be
want to reinstall all the python packages in i386/x86_64 architecture
rather than i386/ppc for 10.6.

--George Nurser.



2009/8/20 Michiel de Hoon :
> Are you on Mac OS X 10.5 or are you on an earlier version? The error message 
> you're seeing indicates that MAC_OS_X_VERSION_10_5 is defined, suggesting 
> that you are on Mac OS X 10.5. But then it should be aware of CTFontRef ... 
> Did you change anything in your Python setup?
>
> --Michiel.
>
> --- On Wed, 8/19/09, George Nurser  wrote:
>
>> From: George Nurser 
>> Subject: [Matplotlib-users] mac os backend not building
>> To: Matplotlib-users@lists.sourceforge.net
>> Date: Wednesday, August 19, 2009, 12:23 PM
>> Hi,
>> I updated matplotlib to svn r 7506, but it won't build. I
>> am having
>> problems with the mac os backend:
>>
>> 10.5.8, gcc 4.0.1:
>> python setup.py build install run from the
>> matplotlib/matplotlib
>> directory gives:
>> .
>> building 'matplotlib.backends._macosx' extension
>> gcc -arch ppc -arch i386 -isysroot
>> /Developer/SDKs/MacOSX10.4u.sdk
>> -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
>> -mno-fused-madd
>> -fno-common -dynamic -DNDEBUG -g -O3
>> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> -I/usr/local/include -I/usr/include -I/usr/X11R6/include
>> -I/usr/X11/include -I.
>> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
>> -Isrc -Iagg24/include -I.
>> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
>> -c src/_macosx.m -o
>> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
>> src/_macosx.m:1885: error: syntax error before
>> ‘setfont’
>> src/_macosx.m:1885: error: syntax error before
>> ‘setfont’
>> src/_macosx.m: In function ‘setfont’:src/_macosx.m: In
>> function ‘setfont’:
>> src/_macosx.m:1895: error: ‘CTFontRef’ undeclared
>> (first use in this function)
>>
>> Possibly some confusion about whether MAC_OS_X_VERSION_10_5
>> is defined??
>>
>> --George Nurser.
>>
>> --
>> 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
>>
>
>
>
>

--
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] bug in imshow for PDF, EPS output

2009-08-20 Thread Jouni K . Seppänen
Michael Fitzgerald  writes:

> Can anyone confirm this bug?  I have added it to the sourceforge
> tracker, ID 2832896.
> https://sourceforge.net/tracker/?func=detail&aid=2832896&group_id=80706&atid=560720

I can see it but haven't been able to make time to investigate yet.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] mac os backend not building

2009-08-20 Thread Jouni K . Seppänen
Michiel de Hoon  writes:

> Are you on Mac OS X 10.5 or are you on an earlier version? The error
> message you're seeing indicates that MAC_OS_X_VERSION_10_5 is defined,
> suggesting that you are on Mac OS X 10.5. But then it should be aware
> of CTFontRef ... Did you change anything in your Python setup?

I get the same error on OS X 10.5.8, gcc 4.0.1, Python 2.5.4 downloaded
from python.org. The failing command is:

gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk 
-fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd 
-fno-common -dynamic -DNDEBUG -g -O3 -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API 
-I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
 -I/usr/local/include -I/usr/include -I. 
-I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
 -Isrc -Iagg24/include -I. 
-I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -c 
src/_macosx.m -o build/temp.macosx-10.3-i386-2.5/src/_macosx.o

Note the MacOSX10.4u.sdk in the isysroot and macosx-10.3 in the name of
the build directory. I suspect that this build of Python has been
compiled with some kind of compatibility settings to be usable on
earlier versions of the OS. Simply replacing 10.4 by 10.5 in the
isysroot option causes worse errors:

src/_macosx.m:1:25: error: Cocoa/Cocoa.h: No such file or directory
src/_macosx.m:2:53: error: ApplicationServices/ApplicationServices.h: No such 
file or directory

Can you suggest something further to try?

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
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] show() problem in Mac OS X 10.5.8

2009-08-20 Thread Kim, Dae-Won
I tested with TKAgg and WXAgg. I just bought macbook and I'm newbie yet. Do
I need to set something special for the multiple show()s?

Thanks,

-Dae-Won

On Thu, Aug 20, 2009 at 10:01 AM, Michiel de Hoon wrote:

> Whether or not you can do multiple show()s depends on which backend you
> use. For example, the Mac OS X native backend has no problems with the
> multiple show()s in your example. Which backend were you using? While
> matplotlib does not support multiple show()s in general, there may be a
> simple solution to get that working for the backend you are using.
>
> --Michiel.
>
> --- On Wed, 8/19/09, Kim, Dae-Won  wrote:
>
> > From: Kim, Dae-Won 
> > Subject: Re: [Matplotlib-users] show() problem in Mac OS X 10.5.8
> > To: "Ryan May" 
> > Cc: matplotlib-users@lists.sourceforge.net
> > Date: Wednesday, August 19, 2009, 2:48 PM
> >
> >  The one 'preliminary' solution I found is using
> > an interactive mode + raw_input.
> > Here is and example,
> >
> > ion()
> > plot([1,2,3,4,5])
> > raw_input('Type Enter')
> > clf()
> >
> >
> > plot([1,2,3,4,5])
> > raw_input('Type_Enter')
> > clf()
> > plot([1,2,3,4,5])
> > show()
> >
> > With this approach, I can press the enter when I want to
> > see next figure.
> >
> >
> >
> > Though It's not as convenient as 'multiple
> > show()'..
> >
> >
> > On Wed, Aug 19, 2009 at 1:57 PM,
> > Kim, Dae-Won 
> > wrote:
> >
> >
> >
> >
> > On Wed, Aug 19, 2009 at 1:02 PM,
> > Ryan May 
> > wrote:
> >
> >
> >
> > On Wed, Aug 19, 2009 at 11:55
> > AM, coati 
> > wrote:
> >
> >
> >
> >
> >
> >
> >
> >  I have a problem with show() command in my macbook
> > machine (Leopard 10.5.8).
> >
> > For example, if I run the script shown below
> >
> > (let assume it is saved as 'test.py', and I run a
> > command 'python test.py'),
> >
> >
> >
> > ---
> >
> >
> >
> > plot([1,2,3,4,5])
> >
> > show() #first window
> >
> > plot([1,2,3,4,5])
> >
> > show() #second window
> >
> > plot([1,2,3,4,5])
> >
> > show() #third window
> >
> >
> >
> > ---
> >
> >
> >
> > Then the first window just pops up and I can see a
> > beautiful straight line
> >
> > :) No problem so far.
> >
> > But, after I close the first window by clicking the close
> > button of the
> >
> > window,
> >
> > other two window (second and third) just pops up and close
> > themselves
> >
> > instantly
> >
> > even though I didn't click the close button...
> >
> > Also, the second and third plot is shown in the same
> > window.
> >
> >
> >
> > I don't have such problem in my Ubuntu machine..
> >
> >
> >
> > Does anybody know reasons?
> > show() actually handles starting the GUI mainloop, so you
> > really shouldn't be calling it more than once from a
> > script.  Quite frankly, it's more amazing that it works
> > on your Ubuntu macine. :)  If you're wanting 3 separate
> > windows, try:
> >
> >
> >
> >
> >
> >
> > plot([1,2,3,4,5])
> > figure()
> > plot([1,2,3,4,5])
> > figure()
> > plot([1,2,3,4,5])
> > show()
> >
> > Ryan
> >
> > --
> > Ryan May
> >
> > Graduate Research Assistant
> > School of Meteorology
> > University of Oklahoma
> >
> >
> >
> >
> >
> > Thanks Ryan,
> >
> > Hm.. it's a bit strange.. I just installed matplotlib
> > at Ubuntu using the package manager :)
> > And, another linux machines (red hat enterprise) can do
> > this too. For the RHELs, I compiled matplotlib source code
> > by myself.
> >
> >
> >
> >
> >
> > figure() works very well, but what I want to do is to check
> > the plots one by one and thus
> > I can exit the script at any time I want (because I usually
> > have lots of figures to check and I don't want
> > to pop up every of them at the same time..)
> >
> >
> >
> >
> >
> > Anyway, thank you very much!
> >
> >
> >
> >
> >
> >
> >
> > -Inline Attachment Follows-
> >
> >
> --
> > 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
> > -Inline Attachment Follows-
> >
> > ___
> > Matplotlib-users mailing list
> > Matplotlib-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
>
>
>
>
--
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.n

Re: [Matplotlib-users] mac os backend not building

2009-08-20 Thread Michiel de Hoon
Are you on Mac OS X 10.5 or are you on an earlier version? The error message 
you're seeing indicates that MAC_OS_X_VERSION_10_5 is defined, suggesting that 
you are on Mac OS X 10.5. But then it should be aware of CTFontRef ... Did you 
change anything in your Python setup?

--Michiel.

--- On Wed, 8/19/09, George Nurser  wrote:

> From: George Nurser 
> Subject: [Matplotlib-users] mac os backend not building
> To: Matplotlib-users@lists.sourceforge.net
> Date: Wednesday, August 19, 2009, 12:23 PM
> Hi,
> I updated matplotlib to svn r 7506, but it won't build. I
> am having
> problems with the mac os backend:
> 
> 10.5.8, gcc 4.0.1:
> python setup.py build install run from the
> matplotlib/matplotlib
> directory gives:
> .
> building 'matplotlib.backends._macosx' extension
> gcc -arch ppc -arch i386 -isysroot
> /Developer/SDKs/MacOSX10.4u.sdk
> -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
> -mno-fused-madd
> -fno-common -dynamic -DNDEBUG -g -O3
> -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API
> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
> -I/usr/local/include -I/usr/include -I/usr/X11R6/include
> -I/usr/X11/include -I.
> -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include
> -Isrc -Iagg24/include -I.
> -I/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5
> -c src/_macosx.m -o
> build/temp.macosx-10.3-i386-2.5/src/_macosx.o
> src/_macosx.m:1885: error: syntax error before
> ‘setfont’
> src/_macosx.m:1885: error: syntax error before
> ‘setfont’
> src/_macosx.m: In function ‘setfont’:src/_macosx.m: In
> function ‘setfont’:
> src/_macosx.m:1895: error: ‘CTFontRef’ undeclared
> (first use in this function)
> 
> Possibly some confusion about whether MAC_OS_X_VERSION_10_5
> is defined??
> 
> --George Nurser.
> 
> --
> 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
> 


  

--
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] onpick on a 2 y plot ( via twinx() ) seems to only allow picking of second axes's artists

2009-08-20 Thread othererik

John,

Thanks for the information. The solution worked so, I can now do a mouse
over over lines from either axes and have a nice little tooltip, etc.  I
found that if I change the zorder of the axis right after attempting to
"pick" on the mouse event, it fails, but it's fine for my needs to just
toggle the "top" axes on mouse events when looking for a mouse hover. 

if self.ax.get_zorder() == 0.1:
ax.set_zorder( 0 )
ax2.set_zorder( 0.1 )
else:
ax2.set_zorder( 0 )
ax.set_zorder( 0.1 )

self.figure.pick( event )

This is perhaps a bit of hackery, but I've not seen any mouse over legends
of the sorts built in.  

Thanks again,
-Erik


John Hunter-4 wrote:
> 
> 
> I'm not sure why it worked before -- that surprises me.  Only one axes
> can receive the pick event currently, so if you have overlapping axes,
> as you do with twinx, the one with the highest zorder will receive the
> pick events.  
> 
> 

-- 
View this message in context: 
http://www.nabble.com/onpick-on-a-2-y-plot-%28-via-twinx%28%29-%29-seems-to-only-allow-picking-of-second-axes%27s-artists-tp25049128p25062402.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
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] show() problem in Mac OS X 10.5.8

2009-08-20 Thread Michiel de Hoon
Whether or not you can do multiple show()s depends on which backend you use. 
For example, the Mac OS X native backend has no problems with the multiple 
show()s in your example. Which backend were you using? While matplotlib does 
not support multiple show()s in general, there may be a simple solution to get 
that working for the backend you are using.

--Michiel.

--- On Wed, 8/19/09, Kim, Dae-Won  wrote:

> From: Kim, Dae-Won 
> Subject: Re: [Matplotlib-users] show() problem in Mac OS X 10.5.8
> To: "Ryan May" 
> Cc: matplotlib-users@lists.sourceforge.net
> Date: Wednesday, August 19, 2009, 2:48 PM
> 
>  The one 'preliminary' solution I found is using
> an interactive mode + raw_input.
> Here is and example,
> 
>     ion()
>     plot([1,2,3,4,5])
>     raw_input('Type Enter')
>     clf()
> 
> 
>     plot([1,2,3,4,5])
>     raw_input('Type_Enter')
>     clf()
>     plot([1,2,3,4,5])
>     show()
> 
> With this approach, I can press the enter when I want to
> see next figure.
> 
> 
> 
> Though It's not as convenient as 'multiple
> show()'..
> 
> 
> On Wed, Aug 19, 2009 at 1:57 PM,
> Kim, Dae-Won 
> wrote:
> 
> 
> 
> 
> On Wed, Aug 19, 2009 at 1:02 PM,
> Ryan May 
> wrote:
> 
> 
> 
> On Wed, Aug 19, 2009 at 11:55
> AM, coati 
> wrote:
> 
> 
> 
> 
> 
> 
> 
>  I have a problem with show() command in my macbook
> machine (Leopard 10.5.8).
> 
> For example, if I run the script shown below
> 
> (let assume it is saved as 'test.py', and I run a
> command 'python test.py'),
> 
> 
> 
> ---
> 
> 
> 
> plot([1,2,3,4,5])
> 
> show() #first window
> 
> plot([1,2,3,4,5])
> 
> show() #second window
> 
> plot([1,2,3,4,5])
> 
> show() #third window
> 
> 
> 
> ---
> 
> 
> 
> Then the first window just pops up and I can see a
> beautiful straight line
> 
> :) No problem so far.
> 
> But, after I close the first window by clicking the close
> button of the
> 
> window,
> 
> other two window (second and third) just pops up and close
> themselves
> 
> instantly
> 
> even though I didn't click the close button...
> 
> Also, the second and third plot is shown in the same
> window.
> 
> 
> 
> I don't have such problem in my Ubuntu machine..
> 
> 
> 
> Does anybody know reasons?
> show() actually handles starting the GUI mainloop, so you
> really shouldn't be calling it more than once from a
> script.  Quite frankly, it's more amazing that it works
> on your Ubuntu macine. :)  If you're wanting 3 separate
> windows, try:
> 
> 
> 
> 
> 
> 
> plot([1,2,3,4,5])
> figure()
> plot([1,2,3,4,5])
> figure()
> plot([1,2,3,4,5])
> show()
> 
> Ryan
> 
> -- 
> Ryan May
> 
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
> 
> 
> 
> 
> 
> Thanks Ryan,
> 
> Hm.. it's a bit strange.. I just installed matplotlib
> at Ubuntu using the package manager :)
> And, another linux machines (red hat enterprise) can do
> this too. For the RHELs, I compiled matplotlib source code
> by myself.
> 
> 
> 
> 
> 
> figure() works very well, but what I want to do is to check
> the plots one by one and thus
> I can exit the script at any time I want (because I usually
> have lots of figures to check and I don't want 
> to pop up every of them at the same time..)
> 
> 
> 
> 
> 
> Anyway, thank you very much!
> 
> 
> 
> 
> 
> 
> 
> -Inline Attachment Follows-
> 
> --
> 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
> -Inline Attachment Follows-
> 
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 


  

--
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] embeding basemap in Tk

2009-08-20 Thread marc desmarais
I think I needed to create an "axes". This seems to have solved my problem.


a = f.add_subplot(111)
map = Basemap(projection='ortho',
  lat_0=34.0,
  lon_0=-117.3,
  resolution='l',
  area_thresh=1000,
  ax=a)

Marc Desmarais

Long Beach, CA, 90814

--- On Wed, 8/19/09, marc desmarais  wrote:

From: marc desmarais 
Subject: embeding basemap in Tk
To: matplotlib-users@lists.sourceforge.net
Date: Wednesday, August 19, 2009, 9:33 PM

How do I embed basemap in Tk?  I tried following the matplotlib example. But 
the following does not work (the earth does not appear):

import matplotlib
matplotlib.use('TkAgg') 

from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, 
NavigationToolbar2TkAgg
from matplotlib.figure import Figure
from mpl_toolkits.basemap import Basemap

import Tkinter as Tk

root = Tk.Tk()
root.wm_title("Embedding in TK")

f = Figure()#figsize=(5,4), dpi=100)

map = Basemap(projection='ortho', lat_0=34.0,lon_0=-117.3, resolution='l' 
area_thresh=1000.)

map.drawcoastlines()
map.drawcountries()
map.fillcontinents(color='coral') 
map.drawmapboundary()

canvas = FigureCanvasTkAgg(f, master=root)
canvas.show()
canvas.get_tk_widget().pack(side=Tk.TOP,
 fill=Tk.BOTH, expand=1)

toolbar = NavigationToolbar2TkAgg( canvas, root )
toolbar.update()
canvas._tkcanvas.pack(side=Tk.TOP, fill=Tk.BOTH, expand=1)

Tk.mainloop()

thanks...

Marc Desmarais

Long Beach, CA, 90814

 






  


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