Re: [Matplotlib-users] A problem of masked "pcolorfast" on WXAgg

2008-02-11 Thread Eric Firing
This is a longstanding problem with the quadmesh extension code that is
used by pcolorfast when the grid is not rectangular.  It is not likely
to be fixed on the maintenance branch, but it is fixed on the svn trunk,
thanks to work by Michael Drooettboom.

Eric

minakawa wrote:
> Hello List,
>  
> I found a problem that masked  "pcolorfast" does not work properly in 
> zooming,
> It seems that masked area is not refreshed after zooming on "WXAgg".
> I think "pcolorfast" works well on pylab.plot though.
>  
> "pcolormesh" is the same while "pcolor"acts appropriately,   
> Please look at the attached picture and try the sample program.
>  
> My environment is;
>  
>Windows XP
>Python 2.4
>WxPython 2.8
>matplotlib 0.91.2
>  
> Noriko Minakawa
> 
> 
> 
> 
> 
> 
> ���#!/usr/bin/env python
> 
> import numpy as npy
> import matplotlib.numerix as nx
> 
> import matplotlib.numerix.ma as ma
> from matplotlib import cm, colors
> 
> import matplotlib
> 
> matplotlib.use('WXAgg')
> from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as 
> FigureCanvas
> from matplotlib.backends.backend_wx import NavigationToolbar2Wx
> 
> from matplotlib.figure import Figure
> 
> import wx
> 
> class CanvasFrame(wx.Frame):
> 
> def __init__(self):
> wx.Frame.__init__(self,None,-1,
>  'CanvasFrame',size=(550,350))
> 
> #self.SetBackgroundColour(wx.NamedColor("WHITE"))
> 
> self.figure = Figure()
> ax1 = self.figure.add_subplot(121)
> ax2 = self.figure.add_subplot(122)
> 
> x = npy.arange(0, 4.0, 0.05, dtype=float)
> y = npy.arange(0, 5.0, 0.05, dtype=float)
> 
> z = npy.sqrt(x[npy.newaxis,:-1]**2 + y[:-1,npy.newaxis]**2)
> 
> Z = ma.masked_where(z < 1, z)
> 
> X, Y = npy.meshgrid(x,y)
> 
> ax1.pcolor(X,Y,Z)
> ax2.pcolorfast(X,Y,Z)
> 
> ax1.set_title('pcolor')
> ax2.set_title('pcolorfast')  
> 
> self.canvas = FigureCanvas(self, -1, self.figure)
> 
> self.sizer = wx.BoxSizer(wx.VERTICAL)
> self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
> self.SetSizer(self.sizer)
> self.Fit()
> 
> self.add_toolbar()  # comment this out for no toolbar
> 
> 
> def add_toolbar(self):
> self.toolbar = NavigationToolbar2Wx(self.canvas)
> self.toolbar.Realize()
> tw, th = self.toolbar.GetSizeTuple()
> fw, fh = self.canvas.GetSizeTuple()
>  
> self.toolbar.SetSize(wx.Size(fw, th))
> self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)
> 
> # update the axes menu on the toolbar
> self.toolbar.update()
> 
> def OnPaint(self, event):
> self.canvas.draw()
> 
> class App(wx.App):
> 
> def OnInit(self):
> 'Create the main window and insert the custom frame'
> frame = CanvasFrame()
> frame.Show(True)
> 
> return True
> 
> app = App(0)
> app.MainLoop()
> 

-
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


[Matplotlib-users] A problem of masked "pcolorfast" on WXAgg

2008-02-11 Thread minakawa
Hello List,

I found a problem that masked  "pcolorfast" does not work properly in 
zooming,
It seems that masked area is not refreshed after zooming on "WXAgg".
I think "pcolorfast" works well on pylab.plot though.

"pcolormesh" is the same while "pcolor"acts appropriately,
Please look at the attached picture and try the sample program.

My environment is;

   Windows XP
   Python 2.4
   WxPython 2.8
   matplotlib 0.91.2

Noriko Minakawa 
<>#!/usr/bin/env python

import numpy as npy
import matplotlib.numerix as nx

import matplotlib.numerix.ma as ma
from matplotlib import cm, colors

import matplotlib

matplotlib.use('WXAgg')
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas
from matplotlib.backends.backend_wx import NavigationToolbar2Wx

from matplotlib.figure import Figure

import wx

class CanvasFrame(wx.Frame):

def __init__(self):
wx.Frame.__init__(self,None,-1,
 'CanvasFrame',size=(550,350))

#self.SetBackgroundColour(wx.NamedColor("WHITE"))

self.figure = Figure()
ax1 = self.figure.add_subplot(121)
ax2 = self.figure.add_subplot(122)

x = npy.arange(0, 4.0, 0.05, dtype=float)
y = npy.arange(0, 5.0, 0.05, dtype=float)

z = npy.sqrt(x[npy.newaxis,:-1]**2 + y[:-1,npy.newaxis]**2)

Z = ma.masked_where(z < 1, z)

X, Y = npy.meshgrid(x,y)

ax1.pcolor(X,Y,Z)
ax2.pcolorfast(X,Y,Z)

ax1.set_title('pcolor')
ax2.set_title('pcolorfast')  

self.canvas = FigureCanvas(self, -1, self.figure)

self.sizer = wx.BoxSizer(wx.VERTICAL)
self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW)
self.SetSizer(self.sizer)
self.Fit()

self.add_toolbar()  # comment this out for no toolbar


def add_toolbar(self):
self.toolbar = NavigationToolbar2Wx(self.canvas)
self.toolbar.Realize()
tw, th = self.toolbar.GetSizeTuple()
fw, fh = self.canvas.GetSizeTuple()
 
self.toolbar.SetSize(wx.Size(fw, th))
self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND)

# update the axes menu on the toolbar
self.toolbar.update()

def OnPaint(self, event):
self.canvas.draw()

class App(wx.App):

def OnInit(self):
'Create the main window and insert the custom frame'
frame = CanvasFrame()
frame.Show(True)

return True

app = App(0)
app.MainLoop()

-
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] Curve fitting ...

2008-02-11 Thread brett . mcsweeney
I would recommend using "pylab.load" for reading the data.  For example:

x, y = pylab.load("filename", unpack=True)  # with other options as 
required





sa6113 <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
09/02/2008 07:34 PM

To
matplotlib-users@lists.sourceforge.net
cc

Subject
[Matplotlib-users]  Curve fitting ...






Hello there, I have a problem on curve fitting , would you please help me 
?! I want to to develop a application that reads a text file with 2 
columns of floating point data (as x and y) and performs a polynomial 
curve fit of the data at the order specified by the end user and then 
provides the curve-fit coefficients as well as the curve fit errors. My 
problem is in curve fit errors , I want to abtain Max and L2-norm of 
error. In addition I use "matplotlib.mlab module " and polyfit function 
for computing polynomial curve fit. Regards. 
View this message in context: Curve fitting ...
Sent from the matplotlib - users mailing list archive at Nabble.com.

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__
-
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



UNITED GROUP
This email message is the property of United Group. The information in this 
email is confidential and may be legally privileged. It is intended solely for 
the addressee. Access to this email by anyone else is unauthorised. If you are 
not the intended recipient, you may not disclose, copy or distribute this 
email, nor take or omit to take any action in reliance on it. United Group 
accepts no liability for any damage caused by this email or any attachments due 
to viruses, interference, interception, corruption or unauthorised access.
If you have received this email in error, please notify United Group 
immediately by email to the sender's email address and delete this document.-
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] Basemap 0.9.9 ImportError

2008-02-11 Thread Jeff Whitaker
Ryan May wrote:
> Hi,
>
> I'm getting the following on Gentoo Linux:
> #python hurrtracks.py
> Traceback (most recent call last):
>   File "hurrtracks.py", line 7, in 
> from matplotlib.toolkits.basemap import Basemap as Basemap
>   File
> "/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/__init__.py",
> line 1, in 
> from basemap import __doc__, __version__
>   File
> "/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/basemap.py",
> line 33, in 
> import pyproj, sys, os, math, dbflib
>   File
> "/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/pyproj.py",
> line 49, in 
> from _geod import Geod as _Geod
> ImportError:
> /usr/lib64/python2.5/site-packages/matplotlib/toolkits/basemap/_geod.so:
> undefined symbol: pj_errno
>
> Any clues as to why this would be happening?  As far as I can tell,
> pj_errno would be in Proj, which basemap has a version of internally.
>
> Ryan
>
>   
Ryan:  Nothing comes immediately to mind - unless something went wrong 
with your build.Could you rebuild basemap and send me the a log of 
the build off-list?

-Jeff


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : [EMAIL PROTECTED]
325 BroadwayOffice : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


-
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


[Matplotlib-users] Basemap 0.9.9 ImportError

2008-02-11 Thread Ryan May
Hi,

I'm getting the following on Gentoo Linux:
#python hurrtracks.py
Traceback (most recent call last):
  File "hurrtracks.py", line 7, in 
from matplotlib.toolkits.basemap import Basemap as Basemap
  File
"/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/__init__.py",
line 1, in 
from basemap import __doc__, __version__
  File
"/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/basemap.py",
line 33, in 
import pyproj, sys, os, math, dbflib
  File
"/usr/lib/python2.5/site-packages/matplotlib/toolkits/basemap/pyproj.py",
line 49, in 
from _geod import Geod as _Geod
ImportError:
/usr/lib64/python2.5/site-packages/matplotlib/toolkits/basemap/_geod.so:
undefined symbol: pj_errno

Any clues as to why this would be happening?  As far as I can tell,
pj_errno would be in Proj, which basemap has a version of internally.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

-
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] Create powerpoint slide and/or presentation from script?

2008-02-11 Thread Alan G Isaac
On Mon, 11 Feb 2008, Ted Drain apparently wrote:
> Is econpy still under development? 

Yes.  Primarily during summers.  ;-)
New developers and other contributors are welcome.

Cheers,
Alan Isaac




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

2008-02-11 Thread chuckwhite8
Mike -- thanks for your response. I thought I had tried this and it didn't 
work. I guess I didn't  I just tried the following equivalent approach:

ML.rcParams['font.family'] = 'serif'
ML.rcParams['font.serif'] = ['Cambria Math'] + ML.rcParams['font.serif']

and it worked like a charm.

Thanks again.

 Michael Droettboom <[EMAIL PROTECTED]> wrote: 
> You shouldn't edit rcsetup.py directly -- that is part of the matplotlib 
> source code.  Instead, you should edit the matplotlibrc settings file.
> 
> In there, you'll actually want to change two settings:
> 
>   1) Add Cambria to the front of the font.serif list
>   2) Set "font.family" to "serif", so that mpl will use that list.
> 
> Hope this helps,
> Mike
> 
> [EMAIL PROTECTED] wrote:
> > I would like to be able to use Cambria font  
> > (http://en.wikipedia.org/wiki/Cambria_(typeface)) for all text on my 
> > charts. 
> > 
> > I am adding these charts to a MS Word 2007 document written in the same 
> > font.
> > 
> > I tried to add Cambria as the fist string in rcsetup.py | defaultParams | 
> > 'font.serif'.  That didn't work.  Can I use this font for the charts?
> > 
> > 
> > -
> > 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
> 
> -- 
> Michael Droettboom
> Science Software Branch
> Operations and Engineering Division
> Space Telescope Science Institute
> Operated by AURA for NASA


-
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] needed grp2idx

2008-02-11 Thread Jouni K . Seppänen
s_pushparaj <[EMAIL PROTECTED]> writes:
> I am working to plot and compare distributions. For that I require the
> grp2idx.m file to run boxplotC.m. Kindly help me get the request m file.

It looks like you got the wrong list. This list is for discussing
matplotlib, a Python plotting package. You refer to "m files", by 
which I suppose you mean Matlab code. You can find Matlab code at
http://www.mathworks.com/matlabcentral/

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


-
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


[Matplotlib-users] needed grp2idx

2008-02-11 Thread s_pushparaj

Dear list
I am working to plot and compare distributions. For that I require the
grp2idx.m file to run boxplotC.m. Kindly help me get the request m file.
with thanks
Pushparaj
-- 
View this message in context: 
http://www.nabble.com/needed-grp2idx-tp15412798p15412798.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
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


[Matplotlib-users] Curve fitting ...

2008-02-11 Thread sa6113

Hello there,

I have a problem on curve fitting , would you please help me ?!

I want to to develop a application that reads a text file with 2 columns of
floating point data (as x and y) and performs a polynomial curve fit of the
data at the order specified by the end user and then provides the curve-fit
coefficients
as well as the curve fit errors.

My problem is in curve fit errors , I want to abtain Max and L2-norm of
error.

In addition I use "matplotlib.mlab module " and polyfit function for
computing polynomial curve fit.

Regards.

-- 
View this message in context: 
http://www.nabble.com/Curve-fitting-...-tp15369630p15369630.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
-
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] Create powerpoint slide and/or presentation from script?

2008-02-11 Thread Ted Drain
Thanks!  Is econpy still under development?

> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> Alan G Isaac
> Sent: Monday, February 11, 2008 10:00 AM
> To: matplotlib-users@lists.sourceforge.net
> Subject: Re: [Matplotlib-users] Create powerpoint slide and/or
> presentation from script?
> 
> On Mon, 11 Feb 2008, Ted Drain apparently wrote:
> > Does anyone know of a way to create a powerpoint slide from a plot?
> 
> http://code.google.com/p/econpy/source/browse/trunk/utilities/mso.
> py>
> 
> hth,
> Alan Isaac
> 
> 
> 
> 
> ---
> --
> 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


-
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] Create powerpoint slide and/or prese ntation from script?

2008-02-11 Thread Alan G Isaac
On Mon, 11 Feb 2008, Ted Drain apparently wrote:
> Does anyone know of a way to create a powerpoint slide from a plot? 

http://code.google.com/p/econpy/source/browse/trunk/utilities/mso.py>

hth,
Alan Isaac




-
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


[Matplotlib-users] Create powerpoint slide and/or presentation from script?

2008-02-11 Thread Ted Drain
Does anyone know of a way to create a powerpoint slide from a plot?  I'm
assuming that it's possible to have a script that savse a PNG of the plot
and then use a VB (or preferably python) script to create a slide (or append
that slide to an existing presentation).   

I've google'ed around but I'm having trouble finding a decent example of
doing this on the web.  Any examples would be greatly appreciated.

Thanks,
Ted


-
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] How to get current value of xlim/ylim?

2008-02-11 Thread Jouni K . Seppänen
Slackenerny <[EMAIL PROTECTED]> writes:

>>>graph = f.add_subplot(...)
> I could help myself with
>> graph.get_xlim()
> So, how could I have helped myself, without annoying you? ;)

The commands getp(graph) and setp(graph) might have helped.

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


-
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] How to get current value of xlim/ylim?

2008-02-11 Thread Mark Bakker
Hello Heiko -

dir(graph) would at least have given you a list of the functions and
attributes, so you may have been able to spot the get_xlim function.
I use that a lot,

Mark


>
> --
>
> Date: Mon, 11 Feb 2008 14:14:03 +0100
> From: Slackenerny <[EMAIL PROTECTED]>
> Subject: Re: [Matplotlib-users] How to get current value of xlim/ylim?
> To: matplotlib-users@lists.sourceforge.net
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=iso-8859-15
>
> Hi,
> I could help myself with
> > graph.get_xlim()
> which I found after finally guessing the right expressions for Google,
> but I wonder how I could have found it in the help() output...
> I've been searching that for quite sometime and didn't come up with
> anything...
> So, how could I have helped myself, without annoying you? ;)
>
> best wishes
>
>
-
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] aspect_ratio in combination with sharex

2008-02-11 Thread Mark Bakker
On Feb 11, 2008 2:35 PM, Michael Droettboom <[EMAIL PROTECTED]> wrote:

> Before I look into this further: what version of mpl are you using?
>

I am using 0.91.2 using the win32 installer for Python 2.4.

Thanks for looking into this, Mark
-
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] aspect_ratio in combination with sharex

2008-02-11 Thread Michael Droettboom
Before I look into this further: what version of mpl are you using?

Mark Bakker wrote:
> I seem to have tracked down the problem.
> After calling the aspect_ratio function, the data limits don't get set.
> When a new axis with sharex is called, it gets the old data limits.
> After I call draw() or ax.draw() the datalimit gets set correctly.
> And creating a subplot with sharex works fine.
> Maybe the datalimit needs to be set at the end of the aspect_ratio function?
> (I presume that is part of the draw() command)
> Mark
> 
> from pylab import *
> 
> x,y = meshgrid(linspace(0,5,5),linspace(0,5,5))
> 
> figure()
> ax = subplot(211)
> ax.contour(x,y,x)
> ax.set_aspect('equal',adjustable='datalim')
> print ax.get_xlim()  # Prints 0 to 5 while datalimit is much larger
> draw()
> print ax.get_xlim()  # Now datalimit is correct and sharex works
> ax2 = subplot(212,sharex=ax)
> draw()
> 
> On Feb 11, 2008 9:56 AM, Mark Bakker <[EMAIL PROTECTED] 
> > wrote:
> 
> Hello -
> 
> I have a hard time getting aspect_ratio to work correctly with sharex.
> This used to work quite a while ago, and has been broken for a long
> time (or at least I don't know how to get it to work)
> But I finally found the time to put a simple example together to
> determine if I do something wrong, or whether this can be fixed easily.
> 
> When I make a small contour plot setting the aspect ratio equal
> works fine:
> 
> from pylab import *
> 
> x,y = meshgrid(linspace(0,5,5),linspace(0,5,5))
> 
> figure()
> ax = subplot(211)
> ax.contour(x,y,x)
> ax.set_aspect('equal',adjustable='datalim')
> draw()
> 
> Note that the datalim on the x-axis is expanded, as the data limit
> on the y-axis is the determining factor.
> 
> If I now try to do the same thing while linking the x-axis of a
> second subplot to the first one, then
> the same call to set_aspect changes the data limit on the y-axis
> while keeping the x-axis fixed.
> That seems inconsistent and is not the behavior I want:
> 
> figure()
> ax = subplot(211)
> ax.contour(x,y,x)
> ax2 = subplot(212,sharex=ax)
> ax.set_aspect('equal',adjustable='datalim')
> draw()
> 
> Any idea what I am doing wrong?
> 
> Thanks, Mark
> 
> 
> 
> 
> 
> -
> 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

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

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

2008-02-11 Thread Michael Droettboom
You shouldn't edit rcsetup.py directly -- that is part of the matplotlib 
source code.  Instead, you should edit the matplotlibrc settings file.

In there, you'll actually want to change two settings:

  1) Add Cambria to the front of the font.serif list
  2) Set "font.family" to "serif", so that mpl will use that list.

Hope this helps,
Mike

[EMAIL PROTECTED] wrote:
> I would like to be able to use Cambria font  
> (http://en.wikipedia.org/wiki/Cambria_(typeface)) for all text on my charts. 
> 
> I am adding these charts to a MS Word 2007 document written in the same font.
> 
> I tried to add Cambria as the fist string in rcsetup.py | defaultParams | 
> 'font.serif'.  That didn't work.  Can I use this font for the charts?
> 
> 
> -
> 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

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA

-
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] How to get current value of xlim/ylim?

2008-02-11 Thread Slackenerny
Hi,
I could help myself with
> graph.get_xlim()
which I found after finally guessing the right expressions for Google,
but I wonder how I could have found it in the help() output...
I've been searching that for quite sometime and didn't come up with
anything...
So, how could I have helped myself, without annoying you? ;)

best wishes

> Hello List,

> assume I'm creating a plot via
>>f = Figure(figsize=(5,4), dpi=100)
>>graph = f.add_subplot(111, autoscale_on=False, xlim=[4,50], ybound=-2)
>>graph.plot(x,y,"g--o", ms=5)
> then the user zooms around a little does this and that.
> Now I want to draw a second plot, which uses the new xlim and ylim
> values from the old plot (i.e. has the same scaling). How can read out
> those values?

> best wishes
> heiko



-- 
Mit freundlichen Grüßen
Slackenerny
mailto:[EMAIL PROTECTED]




-
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


[Matplotlib-users] How to get current value of xlim/ylim?

2008-02-11 Thread Slackenerny
Hello List,

assume I'm creating a plot via
>f = Figure(figsize=(5,4), dpi=100)
>graph = f.add_subplot(111, autoscale_on=False, xlim=[4,50], ybound=-2)
>graph.plot(x,y,"g--o", ms=5)
then the user zooms around a little does this and that.
Now I want to draw a second plot, which uses the new xlim and ylim
values from the old plot (i.e. has the same scaling). How can read out
those values?

best wishes
heiko



-
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] aspect_ratio in combination with sharex

2008-02-11 Thread Mark Bakker
I seem to have tracked down the problem.
After calling the aspect_ratio function, the data limits don't get set.
When a new axis with sharex is called, it gets the old data limits.
After I call draw() or ax.draw() the datalimit gets set correctly.
And creating a subplot with sharex works fine.
Maybe the datalimit needs to be set at the end of the aspect_ratio function?
(I presume that is part of the draw() command)
Mark

from pylab import *

x,y = meshgrid(linspace(0,5,5),linspace(0,5,5))

figure()
ax = subplot(211)
ax.contour(x,y,x)
ax.set_aspect('equal',adjustable='datalim')
print ax.get_xlim()  # Prints 0 to 5 while datalimit is much larger
draw()
print ax.get_xlim()  # Now datalimit is correct and sharex works
ax2 = subplot(212,sharex=ax)
draw()

On Feb 11, 2008 9:56 AM, Mark Bakker <[EMAIL PROTECTED]> wrote:

> Hello -
>
> I have a hard time getting aspect_ratio to work correctly with sharex.
> This used to work quite a while ago, and has been broken for a long time
> (or at least I don't know how to get it to work)
> But I finally found the time to put a simple example together to determine
> if I do something wrong, or whether this can be fixed easily.
>
> When I make a small contour plot setting the aspect ratio equal works
> fine:
>
> from pylab import *
>
> x,y = meshgrid(linspace(0,5,5),linspace(0,5,5))
>
> figure()
> ax = subplot(211)
> ax.contour(x,y,x)
> ax.set_aspect('equal',adjustable='datalim')
> draw()
>
> Note that the datalim on the x-axis is expanded, as the data limit on the
> y-axis is the determining factor.
>
> If I now try to do the same thing while linking the x-axis of a second
> subplot to the first one, then
> the same call to set_aspect changes the data limit on the y-axis while
> keeping the x-axis fixed.
> That seems inconsistent and is not the behavior I want:
>
> figure()
> ax = subplot(211)
> ax.contour(x,y,x)
> ax2 = subplot(212,sharex=ax)
> ax.set_aspect('equal',adjustable='datalim')
> draw()
>
> Any idea what I am doing wrong?
>
> Thanks, Mark
>
>
-
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


[Matplotlib-users] aspect_ratio in combination with sharex

2008-02-11 Thread Mark Bakker
Hello -

I have a hard time getting aspect_ratio to work correctly with sharex.
This used to work quite a while ago, and has been broken for a long time (or
at least I don't know how to get it to work)
But I finally found the time to put a simple example together to determine
if I do something wrong, or whether this can be fixed easily.

When I make a small contour plot setting the aspect ratio equal works fine:

from pylab import *

x,y = meshgrid(linspace(0,5,5),linspace(0,5,5))

figure()
ax = subplot(211)
ax.contour(x,y,x)
ax.set_aspect('equal',adjustable='datalim')
draw()

Note that the datalim on the x-axis is expanded, as the data limit on the
y-axis is the determining factor.

If I now try to do the same thing while linking the x-axis of a second
subplot to the first one, then
the same call to set_aspect changes the data limit on the y-axis while
keeping the x-axis fixed.
That seems inconsistent and is not the behavior I want:

figure()
ax = subplot(211)
ax.contour(x,y,x)
ax2 = subplot(212,sharex=ax)
ax.set_aspect('equal',adjustable='datalim')
draw()

Any idea what I am doing wrong?

Thanks, Mark
-
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