Re: [Matplotlib-users] how to control space between ylabel and yticklabel?

2007-09-21 Thread jetxee
Thu, 20 Sep 2007 16:47:14 -0400, Alan G Isaac [EMAIL PROTECTED]:

 On Thu, 20 Sep 2007, jetxee apparently wrote:
  gca().yaxis.LABELPAD=20 # or the value you like 
 
 This appears to be undocumented?  E.g.,
 http://matplotlib.sourceforge.net/matplotlib.axis.html

I thought it was undocumented, but it appears it is.
It is in `Data and other attributes' of Axis section.

--
jx


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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 control space between ylabel and yaxis (Was: how to control space between ylabel and yticklabel?)

2007-09-21 Thread jetxee
Fri, 21 Sep 2007 09:53:52 +0200, Mark Bakker [EMAIL PROTECTED]:

 I think LABELPAD is the padding between the label and the tick.

I did not think about it. Probably you are correct. Yet it still helps
if you have big/multiline axis label.

 What I would like to control is the distance between the label and the
 y-axis itself.
 This is desired when you do multiple subplots and you want all ylabels to
 align nicely; they may differ
 depending on the numbers along the yticks.

Well, I see the problem.

One solution is to use custom Formatter for yticks/xticks (e.g.
FixedFormatter or FormatStrFormatter) to ensure that tick labels have
the same width/height (printed with the same precision or padded with
spaces). User's Guide explains how to use formatters.


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] error in ax.bar

2007-09-21 Thread Matthias Michler
Hello list,

with the latest version of svn the pylab.hist command doesn't work if I use 
align='center'. The error is due to a problem in the ax.bar - function as you 
can see in the example below. 
Probably width should be an array and not a list if one want to build 
width/2.. 
I'm not sure what is the right solution, but I have two proposals:
- change line 3187 to left = left - npy.asarray(width)/2.0
- uncomment lines 3123-3126 in axes.py, but I don't know what will be 
destroyed by that

thanks in advance for any help, best regards
Matthias

example - code :

In [1]: from numpy import ones, arange
In [2]: from pylab import axes
In [3]: ax = axes()
In [4]: ax.bar(arange(10), ones(10), width=0.8, bottom=None, align='center')
---
exceptions.TypeError Traceback (most recent 
call last)

/home/michler/ipython console

/scratch/michler/SOFT/lib/python2.4/site-packages/matplotlib/axes.py in 
bar(self, left, height, width, bottom, color, edgecolor, linewidth, yerr, 
xerr, ecolor, capsize, align, orientation, log, **kwargs)
   3185 elif align == 'center':
   3186 if orientation == 'vertical':
- 3187 left = left - width/2.
   3188 elif orientation == 'horizontal':
   3189 bottom = bottom-height/2.

TypeError: unsupported operand type(s) for /: 'list' and 'float'
 /scratch/michler/SOFT/lib/python2.4/site-packages/matplotlib/axes.py(3187)bar()
   3186 if orientation == 'vertical':
- 3187 left = left - width/2.
   3188 elif orientation == 'horizontal':

ipdb type(width)
type 'list'
ipdb width/2.
*** TypeError: unsupported operand type(s) for /: 'list' and 'float'

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] latex labels on saved plots

2007-09-21 Thread Jordan Atlas

Do you have ghostscript installed? If you set verbose.level to debug or
debug-annoying, what do you get?

  


I realized that the ghostscript path wasn't set up properly, so that was 
what was causing part of the problem with EPS files.  It works sometimes 
now (sometimes the EPS is just a blank file, even though the plot shows 
up properly when I do pylab.show().  I'm still trying to narrow down 
what ameks the difference here).

I guess I mean TeX-like mathtext format parsed by matplotlib.  For 
example, I'm using things like this:

rc('text', usetex=True) 
Plotting.xlabel(r'\textbf{Time (s)}', fontsize=16)



usetex=True means that you are trying to use an external TeX program.

  


Ok, so am I to understand that usetex=True is not supported for PDF/EPS 
output?  Can you explain what the Tex-like mathtext format parsed by 
matplotlib is?

Thank you for your assistance,

--Jordan


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] latex labels on saved plots

2007-09-21 Thread Michael Droettboom
Jordan Atlas wrote:
 Ok, so am I to understand that usetex=True is not supported for PDF/EPS 
 output?

In 0.90.1, it is not supported in PDF.

  Can you explain what the Tex-like mathtext format parsed by 
 matplotlib is?

matplotlib also has a built-in math formatting engine that does not use 
TeX itself.  You can use it by leaving usetex=False (the default) and 
putting a '$' at the beginning and end of your TeX strings.

   Plotting.xlabel(r'$\alpha^2$')

Unfortunately, the built-in engine only supports a subset of what TeX 
can do.  That subset is much smaller in 0.90.1 than in the current SVN, 
where much progress has recently been made.

See here for information pertaining to version 0.90.1:

   http://matplotlib.sourceforge.net/matplotlib.mathtext.html

Cheers,
Mike

-- 
Michael Droettboom
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 2005.
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] Screen location

2007-09-21 Thread Yo mismo Hotmail
Dear John,

First of all, thanks for your response. When I try this

fig = figure()
fig.canvas.manager.window.move(100,400)

python tells me that window has no attribute move. It's strange because I
can choose many differents attributes like

 fig.canvas.manager.window
Tkinter.Tk instance at 0x019100F8
 fig.canvas.manager.window.attributes
bound method Tk.wm_attributes of Tkinter.Tk instance at 0x019100F8
 fig.canvas.manager.window.frame
bound method Tk.wm_frame of Tkinter.Tk instance at 0x019100F8

Then I've got a window class from Tk, but not the attriburte move. I need to
install Tkinter apart? Pylab suports differents GUIs. When you install
matplotlib/pylab package wich backends are installed? All?

I know embedding it's a good option, but for the moment it's too much work
for me. I've got not enought time. My programe has got differents modules
that call pylab plots, and a simple GUI which call this modules. I hope I
can move canvas frames. In the future I'll embedding matplotlib with some
package like wxmpl, but in the future.

Thanks again,
Miquel

On 9/20/07, John Hunter [EMAIL PROTECTED] wrote:

 On 9/19/07, Yo mismo Hotmail [EMAIL PROTECTED] wrote:
  Hi all!
 
  I'm actually working with Matplotlib/Pylab Interface for making 2D plot.
 I
  need to specify screen location where the frame will appear and I don't
 know
  how. Supose a simple example like:
 
  from pylab import *
 
  t = arange(0.0,10,0.01)
  s = 20*sin(2*pi*t)
  c = 20*cos(2*pi*t)
 
  figure(1)
  plot(s)
  figure(2)
  plot(c)
  show()
 
  If I do it in this way, one frame is hidded behind the other one. How
 can I
  modify frames attributes in order to change their position on the
 screen?

 pylab doesn't explicitly support this -- I have encouraged backend
 maintainers to attach the window instance to the figure manager
 instance, but I am not sure of all backends support this (GTK* and Tk
 do...).  The window instance will be a GUI specific widget.  Eg in the
 GTK* backends, a gtk.Window

 fig = figure()
 fig.canvas.manager.window.move(100,400)

 and other methods at


 http://www.pygtk.org/pygtk2reference/class-gtkwindow.html#method-gtkwindow--set-position

 If you need a lot of control, you are advised to embed mpl into a GUI
 app, eg see examples/embedding*.py in the mpl examples dir


 http://matplotlib.sourceforge.net/examples/http://matplotlib.sourceforge.net/examples/


 JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] Screen location

2007-09-21 Thread John Hunter
On 9/21/07, Yo mismo Hotmail [EMAIL PROTECTED] wrote:
 Dear John,

 First of all, thanks for your response. When I try this

 fig = figure()
 fig.canvas.manager.window.move(100,400)

  python tells me that window has no attribute move. It's strange because I
 can choose many differents attributes like

Well, the example I posted was for a *gtk* window, not a tk window.
You will need to look at the API for the tk window to make the correct
call.  We do not provide an abstract API across the GUI windows we
utilize internally.   We give you access to the widget, and if you
want to make GUI specific calls on it, good luck, but this is not
encouraged or supported.

JDH

JDH

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] Screen location

2007-09-21 Thread Christopher Barker
John Hunter wrote:
 fig = figure()
 fig.canvas.manager.window.move(100,400)

 Well, the example I posted was for a *gtk* window, not a tk window.

And, for what it's worth, wx spells it Move(), with a capital M.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/ORR(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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] creating a timeline

2007-09-21 Thread John Hunter
On 9/20/07, Ryan Krauss [EMAIL PROTECTED] wrote:

 which also gets rid of my bottom x axis and leaves tick marks along
 the top (see attached).  How do I get rid of the top tick marks, keep
 the bottom ones, and get the bottom x-axis back?

I think this is what you are looking for:

from pylab import figure, show

fig = figure()
ax = fig.add_subplot(111)

ax.axesFrame.set_data((0,0,1), (1,0,0))
ax.axesPatch.set_edgecolor('white')
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')

ax.plot(range(10))

show()

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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