Re: [Matplotlib-users] deb or rpm packages

2008-06-19 Thread rex
Andrew Straw [EMAIL PROTECTED] [2008-06-05 09:42]:
For i386:

http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_i386.deb

For amd64:

http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_amd64.deb

For all arch:

http://debs.astraw.com/hardy/python-matplotlib-data_0.98.0-0ads2_all.deb
http://debs.astraw.com/hardy/python-matplotlib-doc_0.98.0-0ads2_all.deb

I tried to install on Debian Lenny with Python 2.5 and it fails with:

python-matplotlib depends on python-wxgtk2.8

wxgtk2.8 doesn't seem to be available for Python 2.5 and Lenny at:

http://apt.wxwidgets.org/dists/

Any ideas, short of building from source?

Thanks,

-rex
-- 

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] deb or rpm packages

2008-06-19 Thread Andrew Straw
rex wrote:
 Andrew Straw [EMAIL PROTECTED] [2008-06-05 09:42]:
   
 For i386:

 http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_i386.deb

 For amd64:

 http://debs.astraw.com/hardy/python-matplotlib_0.98.0-0ads2_amd64.deb

 For all arch:

 http://debs.astraw.com/hardy/python-matplotlib-data_0.98.0-0ads2_all.deb
 http://debs.astraw.com/hardy/python-matplotlib-doc_0.98.0-0ads2_all.deb
 

 I tried to install on Debian Lenny with Python 2.5 and it fails with:

 python-matplotlib depends on python-wxgtk2.8

 wxgtk2.8 doesn't seem to be available for Python 2.5 and Lenny at:

 http://apt.wxwidgets.org/dists/

 Any ideas, short of building from source?
   
That's probably your best bet at this point -- my repo is for Ubuntu
Hardy. It looks like you can get the Debian experimental package of
wxwidgets 2.8 at
http://packages.debian.org/hu/source/experimental/wxwidgets2.8 . I have
no idea why this isn't in unstable or testing yet -- a few minutes of
googling didn't find anything.

-Andrew

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Image plotting using the OO interface

2008-06-19 Thread Scott Sinclair
 David Goldsmith [EMAIL PROTECTED] 06/19/08 9:39 AM 
Hi!  I'm having trouble figuring out how to plot an array as an image with the 
OO interface - please help (e.g., w/ an example).  Thanks,

DG


From the examples 
http://matplotlib.sourceforge.net/matplotlib_examples_0.98.0.zip

../examples/api/agg_oo.py


#!/usr/bin/env python

A pure OO (look Ma, no pylab!) example using the agg backend

from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure

fig = Figure()
canvas = FigureCanvas(fig)
ax = fig.add_subplot(111)
ax.plot([1,2,3])
ax.set_title('hi mom')
ax.grid(True)
ax.set_xlabel('time')
ax.set_ylabel('volts')
canvas.print_figure('test')


You can replace the call to ax.plot() with a call to ax.imshow() or ax.pcolor()

Hope that gets you going.

Cheers,
Scott

Please find our Email Disclaimer here: http://www.ukzn.ac.za/disclaimer/

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] tesgdal in examples of basemap

2008-06-19 Thread Jose Gómez-Dans
Hi,

On Thursday 19 June 2008 00:16:39 KURT PETERS wrote:
 array = gd.ReadAsArray()
 AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

 Anyone know what the problem is?  Do I need something else?

Did you download the Denver DEM from USGS? From testgdal.py:
# download from 
# http://edcftp.cr.usgs.gov/pub/data/DEM/250/D/denver-w.gz

It should work after that...

Cheers,
Jose


-- 
NERC Centre for Terrestrial Carbon Dynamics,
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Image plotting using the OO interface

2008-06-19 Thread Alan G Isaac
On Thu, 19 Jun 2008, Scott Sinclair apparently wrote:
 canvas = FigureCanvas(fig)

What is the relationship between a figure and a canvas?

My impression is the following.  You can do all your
drawing on a figure.  When you want to render the figure
(e.g., to screen, or printing to file), and not until then, 
you need a canvas.  A canvas will therefore always be 
associated with a particular backend.

But when one creates a figure canvas, the canvas registers 
itself with the figure.  What does the figure get out of this?
(E.g., if we want the figure to draw itself to the canvas,
the canvas could always pass itself to the figure. Right?)

Thank you,
Alan Isaac





-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Large axis labels/positioning the axes

2008-06-19 Thread John Hunter
On Wed, Jun 18, 2008 at 2:42 PM, David Warde-Farley [EMAIL PROTECTED] wrote:

 One more related thing: is there any way to retrieve the size of a textbox
 in figure coordinates, something like
 ax.get_ymajorticklabels[0].get_width()?

This is not very easy since the renderer is not known until the figure
is drawn.  After the window is drawn and the text instance knows its
renderer, you can call t.get_window_extent().  So you would likely
want to connect to the on_draw method and get the window extent
there, and then do something with it, eg move the left of the canvas
over.  Here is a recursive, iterative solution that will gradually
move the left of the subplot over until the label fits w/o going
outside the figure border (requires 0.98)::

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(10))
ax.set_yticks((2,5,7))
labels = ax.set_yticklabels(('really, really, really', 'long', 'labels'))

def on_draw(event):
for label in labels:
bbox = label.get_window_extent()
if bbox.xmin0:
print  'adjusting left of subplot'
fig.subplots_adjust(left=1.1*fig.subplotpars.left)
fig.canvas.draw()
break

fig.canvas.mpl_connect('draw_event', on_draw)

plt.show()



 Also, I'm kind of wondering why things like set_text() on that doesn't work.
 In general I haven't had much success with editing the properties of objects
 like this.

The tick labels are a bit special, since they are generated on the fly
(eg if you are panning and zooming, new ticks must be created and sold
ones destroyed).  So you can't set their text directly, but rather
need to create a tick locator and a tick formatter as described in
Users Guide Chapter 6 -
http://matplotlib.sourceforge.net/users_guide_0.98.0.pdf and the
examples

  http://matplotlib.sourceforge.net/examples/pylab/custom_ticker1.py
  http://matplotlib.sourceforge.net/examples/pylab/major_minor_demo1.py

JDH

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Radar / Spider Chars

2008-06-19 Thread John Hunter
On Wed, Jun 18, 2008 at 2:43 PM, Curtis Jensen [EMAIL PROTECTED] wrote:
 Nice.  Thanks.  I had tried to do something similar, but kept getting
 a curved line between each data point.
 Also, I too got errors with a previous versions of matplotlib, but 0.98 works.

 If someone were willing to add Radar plots to the matplotlib
 functionality, would this be wanted by the users or maintainers?

Yes, certainly.  You may want to take a look at the polar
implementation (can you inherit from it?) to reuse as much as
possible.  Michael has also written a short guide to developers
working with nonlinear projections

http://matplotlib.sourceforge.net/doc/html/devel/add_new_projection.html

JDH

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Image plotting using the OO interface

2008-06-19 Thread John Hunter
On Thu, Jun 19, 2008 at 8:58 AM, Alan G Isaac [EMAIL PROTECTED] wrote:
 On Thu, 19 Jun 2008, Scott Sinclair apparently wrote:
 canvas = FigureCanvas(fig)

 What is the relationship between a figure and a canvas?

The Figure is the top level matplotlib artist container that contains
all the other matplotlib.artist.Artist instances (Axes, Line2D,
etc..).  Artists don't know anything about output formats (GDK, PS,
SVG) but they do know about renderers
(matplotlib.backend_bases.RendererBase) which have methods like
draw_line, draw_rectangle, and draw_text.  The renderer subclasses
know the various output languages like postscript or svg.  The canvas
is the target of the drawing by the renderer, and the canvas puts all
the pieces together.  The canvas contains a renderer that knows how to
draw on the canvas, and it also contains the figure instance to be
drawn.  The canvas calls

  fig.draw(renderer)

and then the figure instance in turn calls

  self.figurePatch.draw(renderer)

and then the figurePatch, a matplotlib.patches.Rectangle instance, calls

  renderer.draw_rectangle(graphicscontext, 25, 40)

So the renderer doesn't know anything about the matplotlib artist
Rectangle, but the Rectangle knows how to tell the renderer to draw
itself.  This design decouples the functionality to make it possible
to change the artists w/o affecting the renderers, so the drawing API
is not affected by the matplotlib artist classes.  This is covered
somewhat in Chapter 10 of the user's guide
http://matplotlib.sourceforge.net/users_guide_0.98.0.pdf

JDH

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Rotating an axes instance

2008-06-19 Thread Bryan Fodness
I have an axes instance that I would like to rotate.  I see that there is a
rotation keyword for text and would like to do something like that with a
plot.  Is this possible.

-- 
The game of science can accurately be described as a never-ending insult to
human intelligence. - João Magueijo

Any intelligent fool can make things bigger, more complex, and more
violent. It takes a touch of genius - and a lot of courage - to move in the
opposite direction.  -Albert Einstein
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] tesgdal in examples of basemap

2008-06-19 Thread KURT PETERS
Thanks, sadly, I DID download them and had them in the right directory.  I 
had just not decompressed them!
Kurt


--

Message: 4
Date: Thu, 19 Jun 2008 14:47:51 +0100
From: Jose G?mez-Dans [EMAIL PROTECTED]
Subject: Re: [Matplotlib-users] tesgdal in examples of basemap
To: matplotlib-users@lists.sourceforge.net
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain;  charset=iso-8859-1

Hi,

On Thursday 19 June 2008 00:16:39 KURT PETERS wrote:
  array = gd.ReadAsArray()
  AttributeError: 'NoneType' object has no attribute 'ReadAsArray'
 
  Anyone know what the problem is?  Do I need something else?

Did you download the Denver DEM from USGS? From testgdal.py:
# download from
# http://edcftp.cr.usgs.gov/pub/data/DEM/250/D/denver-w.gz

It should work after that...

Cheers,
Jose


--
NERC Centre for Terrestrial Carbon Dynamics,
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK



-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] tesgdal in examples of basemap

2008-06-19 Thread Jose Gómez-Dans
Hi,

On Thursday 19 June 2008 00:16:39 KURT PETERS wrote:
 array = gd.ReadAsArray()
 AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

 Anyone know what the problem is?  Do I need something else?

Did you download the Denver DEM from USGS? From testgdal.py:
# download from 
# http://edcftp.cr.usgs.gov/pub/data/DEM/250/D/denver-w.gz

It should work after that...

Cheers,
Jose
-- 
NERC Centre for Terrestrial Carbon Dynamics,
Department of Geography, University College London
Gower Street, London WC1E 6BT, UK

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Rotating an axes instance

2008-06-19 Thread John Hunter
On Thu, Jun 19, 2008 at 11:23 AM, Bryan Fodness [EMAIL PROTECTED] wrote:
 I have an axes instance that I would like to rotate.  I see that there is a
 rotation keyword for text and would like to do something like that with a
 plot.  Is this possible.

Not currently, no.

JDH

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] threading problems

2008-06-19 Thread Daniel Ashbrook
I need to have a plot window hang around and be occasionally updated by 
my script as it does things. I've been looking through examples and have 
not been able to get anything to work.

My current approach, inspired by strip_chart_demo.py and others in the 
animation examples, is:

import gobject, matplotlib, sys
matplotlib.use('GTKAgg')
import matplotlib.pylab as pylab
import threading, time, random

class PylabThread(threading.Thread):
   def __init__(self):
 threading.Thread.__init__(self)
   def update(self):
 pylab.draw()
   def run(self):
 gobject.idle_add(self.update)
 pylab.plot([random.random() for i in xrange(1000)])
 pylab.show()


if __name__ == __main__:
   p = PylabThread()
   p.start()

   i = 0
   while True:
 print i
 i += 1
 time.sleep(.5)


Running this, however, yields the odd behavior that you only get numbers 
printed every half second (as you should) if you move the mouse (or hit 
keys, or otherwise generate events) within the plot window!

What's going on, and how can I fix this?

Thanks!



dan

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] World coordinates on image axes

2008-06-19 Thread John Hunter
On Thu, Jun 19, 2008 at 12:26 PM, Cormac Purcell
[EMAIL PROTECTED] wrote:
 Hello,

 I need to find a way to apply a offset and scaling factor to the X and Y
 axes on an image plot. Instead of showing the pixel number I would like
 to transform the axes to 'world' coordinates, in this case degrees of
 Right-ascension and Declination in an astronomical image. The
 transformation is defined on both axes via an offset and a scaling factor.

I believe you are looking for the extent argument to imshow, which
will handle a linear scaling and offset.

JDH

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] threading problems

2008-06-19 Thread John Hunter
On Thu, Jun 19, 2008 at 1:40 PM, Daniel Ashbrook [EMAIL PROTECTED] wrote:
 I need to have a plot window hang around and be occasionally updated by
 my script as it does things. I've been looking through examples and have
 not been able to get anything to work.

 My current approach, inspired by strip_chart_demo.py and others in the
 animation examples, is:

Use the gtk mainloop and do your figure updates in a timeout add or a
idle handler (as suggested in the animation tutorial at
http://www.scipy.org/Cookbook/Matplotlib/Animations

import gobject
import numpy as np
import matplotlib
matplotlib.use('GTKAgg')

import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)
line, = ax.plot(np.random.rand(10))
ax.set_ylim(0, 1)

def update():
line.set_ydata(np.random.rand(10))
fig.canvas.draw_idle()
return True  # return False to terminate the updates

gobject.timeout_add(100, update)  # you can also use idle_add to
update when gtk is idle
plt.show()

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] threading problems

2008-06-19 Thread Daniel Ashbrook
John Hunter wrote:
 Use the gtk mainloop and do your figure updates in a timeout add or a
 idle handler (as suggested in the animation tutorial at
 http://www.scipy.org/Cookbook/Matplotlib/Animations

Excellent, thanks. Your sample code adapted nicely; appended below for 
posterity.


dan



import gobject
import numpy as np
import matplotlib
matplotlib.use('GTKAgg')
import matplotlib.pyplot as plt
import threading, time

class PylabThread(threading.Thread):
   def __init__(self):
 threading.Thread.__init__(self)
 self.fig = plt.figure()
 ax = self.fig.add_subplot(111)
 self.line, = ax.plot(np.random.rand(10))
 ax.set_ylim(0, 1)
   def update(self):
 self.line.set_ydata(np.random.rand(10))
 self.fig.canvas.draw_idle()
 return True  # return False to terminate the updates
   def run(self):
 gobject.timeout_add(100, self.update)  # you can also use idle_add 
to update when gtk is idle
 plt.show()


if __name__ == __main__:
   p = PylabThread()
   p.start()

   i = 0
   while True:
 print %.2f: %d % (time.time(), i)
 i += 1
 time.sleep(.5)

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] threading problems

2008-06-19 Thread John Hunter
On Thu, Jun 19, 2008 at 2:30 PM, Daniel Ashbrook [EMAIL PROTECTED] wrote:
 John Hunter wrote:

 Use the gtk mainloop and do your figure updates in a timeout add or a
 idle handler (as suggested in the animation tutorial at
 http://www.scipy.org/Cookbook/Matplotlib/Animations

 Excellent, thanks. Your sample code adapted nicely; appended below for
 posterity.

I don't think this is what you want.  gtk is already threaded.  By
doing things in the gtk mainloop, you are using their threading.  You
are asking for a world of pain if you try and mix in python threading
unless you really know what you are doing.  The point of the example
is that you don't need to use python threads.  All your printing and
figure updating can be done in function calls activated by the gtk
loop.

JDH

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] threading problems

2008-06-19 Thread Daniel Ashbrook
John Hunter wrote:
 I don't think this is what you want.  gtk is already threaded.  By
 doing things in the gtk mainloop, you are using their threading.  You
 are asking for a world of pain if you try and mix in python threading
 unless you really know what you are doing.  The point of the example
 is that you don't need to use python threads.  All your printing and
 figure updating can be done in function calls activated by the gtk
 loop.

Ok, I think I see your point. Let me explain what I'm after, then. I'm 
doing some distributed computing and need to have a pylab process 
running remotely that accepts plotting commands. The issue is that the 
show() command takes over the main thread of execution, so I can't have 
my listening process running. Essentially I need to:

1) Pop up a figure()
2) Start the drawing loop
3) Start the socket listener
4) When the listener gets commands, execute them (plot, etc)

Is this something that I can do?


Thanks,


dan

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Image plotting using the OO interface

2008-06-19 Thread Alan G Isaac
On Thu, 19 Jun 2008, John Hunter apparently wrote:
 This is covered somewhat in Chapter 10 of the user's guide 
 http://matplotlib.sourceforge.net/users_guide_0.98.0.pdf 

Your post was helpful.
I still do not see why a figure has a canvas as data.
I'll read that chapter.
Thanks!
Alan




-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Image plotting using the OO interface

2008-06-19 Thread John Hunter
On Thu, Jun 19, 2008 at 3:37 PM, Alan G Isaac [EMAIL PROTECTED] wrote:
 On Thu, 19 Jun 2008, John Hunter apparently wrote:
 This is covered somewhat in Chapter 10 of the user's guide
 http://matplotlib.sourceforge.net/users_guide_0.98.0.pdf

 Your post was helpful.
 I still do not see why a figure has a canvas as data.
 I'll read that chapter.

This is just a convenience so the child can see the parent.  If I have
a function that gets a line, I can do line.axes.figure.canvas and walk
backwards up the containment hierarchy to get what I need.  This is
backwards because a canvas holds a figure which holds an axes which
holds a line, but everybody stores a reference to their parent.  A
side effect of having  so many cyclic references is that we cannot use
__del__ anywhere in the mpl class hierarchy since this breaks garbage
collection with cyclic references.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Producing a plot that contains two different y-axis scales

2008-06-19 Thread Adam Mercer
Hi

I'm trying to produce a single plot containing two different datasets
that share the same x-axis but different y-axes, i.e. I would like one
y-axis to be on the left of the plot and the other on the right hand
side. I've looked for example that illustrates how to do this but have
been unable to find an example. Can anyone point me to and example or
the appropriate methods that would allow me to do this?

Cheers

Adam

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Producing a plot that contains two different y-axis scales

2008-06-19 Thread Darren Dale
Hi Adam,

On Thursday 19 June 2008 8:01:32 pm Adam Mercer wrote:
 I'm trying to produce a single plot containing two different datasets
 that share the same x-axis but different y-axes, i.e. I would like one
 y-axis to be on the left of the plot and the other on the right hand
 side. I've looked for example that illustrates how to do this but have
 been unable to find an example. Can anyone point me to and example or
 the appropriate methods that would allow me to do this?

You are looking for two_scales.py, it is distributed with matplotlib's 
collection of examples: 
http://matplotlib.sourceforge.net/matplotlib_examples_0.98.0.zip


Darren

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Global font size

2008-06-19 Thread Bill Baxter
Matplot folks,
Is there a way to increase all font sizes globally across the board?
I played around with some RC parameters but they don't seem to have
any effect.

I found that I could more or less achieve the desired result by the
following steps:
1) plot to something like subplot(6,6,1).  That is, make a 6x6 plot
grid but only use the upper left subplot of it.
With that the text is large relative to the plot, but spacing is not good, so...
2) Make plot window really large so text isn't overlapping so much
3) Save result to svg
4) in Inkscape or other svg editor cut out the big unused region, and
fix badly positioned labels (e.g. text too far left in legend box).

That basically worked, but it's quite hacky.

I think it's pretty obvious why this would be useful, but if not, my
particular use case is that I want to make some graphs that will be
very small in the final document, so the text needs to be at about 9pt
in an overall bounding box of approx. 3cm x 2cm.

This question was asked once before in 2006 but apparently got no answer:
http://sourceforge.net/mailarchive/message.php?msg_name=1137144577.12809.4.camel%40inpc93.et.tudelft.nl

Thanks for any hints!
--bb

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Global font size

2008-06-19 Thread Darren Dale
Hi Bill,

On Thursday 19 June 2008 8:18:12 pm Bill Baxter wrote:
 Matplot folks,
 Is there a way to increase all font sizes globally across the board?
 I played around with some RC parameters but they don't seem to have
 any effect.

Here's a note from the default matplotlibrc:

# note that font.size controls default text sizes.  To configure
# special text sizes tick labels, axes, labels, title, etc, see the rc
# settings for axes and ticks. Special text sizes can be defined
# relative to font.size, using the following values: xx-small, x-small,
# small, medium, large, x-large, xx-large, larger, or smaller
#font.size   : 12.0

You set that size, and then set a relative size (like medium) for your other 
settings. I should include this in the new docs, if it is not covered 
already.

Darren

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Global font size

2008-06-19 Thread Bill Baxter
On Fri, Jun 20, 2008 at 10:01 AM, Darren Dale [EMAIL PROTECTED] wrote:
 Hi Bill,

 On Thursday 19 June 2008 8:18:12 pm Bill Baxter wrote:
 Matplot folks,
 Is there a way to increase all font sizes globally across the board?
 I played around with some RC parameters but they don't seem to have
 any effect.

 Here's a note from the default matplotlibrc:

 # note that font.size controls default text sizes.  To configure
 # special text sizes tick labels, axes, labels, title, etc, see the rc
 # settings for axes and ticks. Special text sizes can be defined
 # relative to font.size, using the following values: xx-small, x-small,
 # small, medium, large, x-large, xx-large, larger, or smaller
 #font.size   : 12.0

 You set that size, and then set a relative size (like medium) for your other
 settings. I should include this in the new docs, if it is not covered
 already.

According to the docs the rc function is supposed to be able to do the
same thing as editing matplotlibrc.
I tried doing
  rc('font', size=20)
and several variations of that invoked at several different places in
my file, and it seemed to have no effect.

Did I do it wrong?  Does rc() not really work as advertised?
Something completely different?

For what it's worth my matplotlib.pylab.__version__ is '1.1.0'

--bb

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] tick_left() and tick_right() with minor tick marks

2008-06-19 Thread Adam Mercer
Hi

I have a plot that has two different y-axis scales and I want
appropriate tick marks for the different y-axes. ie I want the tick
marks on the left axis to correspond to the scale on the left axis
etc... As far as I can tell the way to accomplish this, after
consulting the documentation, is to use the tick_left() and
tick_right() methods, I therefore have the following code:

axes1.yaxis.tick_left()
axes1.yaxis.set_major_locator(pylab.MultipleLocator(0.1))
axes1.yaxis.set_minor_locator(pylab.MultipleLocator(0.05))
axes2.yaxis.tick_right()
axes2.yaxis.set_major_locator(pylab.MultipleLocator(5))
axes2.yaxis.set_minor_locator(pylab.MultipleLocator(1))

but the minor ticks are on both the left and right y-axes. How can I
make the minor ticks for axes1 only appear on the the left and the
minor ticks for axes2 appear on the right?

Cheers

Adam

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Global font size

2008-06-19 Thread Darren Dale
On Thursday 19 June 2008 9:13:15 pm Bill Baxter wrote:
 On Fri, Jun 20, 2008 at 10:01 AM, Darren Dale [EMAIL PROTECTED] wrote:
  Hi Bill,
 
  On Thursday 19 June 2008 8:18:12 pm Bill Baxter wrote:
  Matplot folks,
  Is there a way to increase all font sizes globally across the board?
  I played around with some RC parameters but they don't seem to have
  any effect.
 
  Here's a note from the default matplotlibrc:
 
  # note that font.size controls default text sizes.  To configure
  # special text sizes tick labels, axes, labels, title, etc, see the rc
  # settings for axes and ticks. Special text sizes can be defined
  # relative to font.size, using the following values: xx-small, x-small,
  # small, medium, large, x-large, xx-large, larger, or smaller
  #font.size   : 12.0
 
  You set that size, and then set a relative size (like medium) for your
  other settings. I should include this in the new docs, if it is not
  covered already.

 According to the docs the rc function is supposed to be able to do the
 same thing as editing matplotlibrc.
 I tried doing
   rc('font', size=20)
 and several variations of that invoked at several different places in
 my file, and it seemed to have no effect.

 Did I do it wrong?  Does rc() not really work as advertised?
 Something completely different?

I think in this case, you need to change those settings before importing 
pylab:

import matplotlib
matplotlib.rcParams['font.size'] = 12
import pylab

or better yet, do it with a matplotlibrc file

 For what it's worth my matplotlib.pylab.__version__ is '1.1.0'

Really? That looks like numpy's version, not matplotlib's.

Darren

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Global font size

2008-06-19 Thread Bill Baxter
Thanks for the reply.

On Fri, Jun 20, 2008 at 10:32 AM, Darren Dale [EMAIL PROTECTED] wrote:
 On Thursday 19 June 2008 9:13:15 pm Bill Baxter wrote:
 On Fri, Jun 20, 2008 at 10:01 AM, Darren Dale [EMAIL PROTECTED] wrote:
  Hi Bill,
 
  On Thursday 19 June 2008 8:18:12 pm Bill Baxter wrote:
  Matplot folks,
  Is there a way to increase all font sizes globally across the board?
  I played around with some RC parameters but they don't seem to have
  any effect.
 
  Here's a note from the default matplotlibrc:
 
  # note that font.size controls default text sizes.  To configure
  # special text sizes tick labels, axes, labels, title, etc, see the rc
  # settings for axes and ticks. Special text sizes can be defined
  # relative to font.size, using the following values: xx-small, x-small,
  # small, medium, large, x-large, xx-large, larger, or smaller
  #font.size   : 12.0
 
  You set that size, and then set a relative size (like medium) for your
  other settings. I should include this in the new docs, if it is not
  covered already.

 According to the docs the rc function is supposed to be able to do the
 same thing as editing matplotlibrc.
 I tried doing
   rc('font', size=20)
 and several variations of that invoked at several different places in
 my file, and it seemed to have no effect.

 Did I do it wrong?  Does rc() not really work as advertised?
 Something completely different?

 I think in this case, you need to change those settings before importing
 pylab:

 import matplotlib
 matplotlib.rcParams['font.size'] = 12
 import pylab

I see.  I usually just do it in one shot like:
  from matplotlib import pylab as plot

 or better yet, do it with a matplotlibrc file

 For what it's worth my matplotlib.pylab.__version__ is '1.1.0'

 Really? That looks like numpy's version, not matplotlib's.

I guess it's just namespace weirdness then.  Using the import
incantation I gave above, plot.__version__ reports 1.1.0.
matplotlib.__version__ gives '0.98.0'.

I tried putting this in my matplotlibrc but it seems to have no effect:

font.size : 30.0

Just to make sure things were actually working I also tried this:

   font.weight : bold

That one worked, all text on the plot turned bold.  That suggests to
me that the global font size setting probably just has a bug at the
moment.

--bb

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CocoaAgg backend seems to be broken

2008-06-19 Thread Charles Moad
On Jun 12, 2008, at 4:27 PM, John Hunter wrote:

 On Thu, Jun 12, 2008 at 2:58 PM, İsmail Dönmez [EMAIL PROTECTED]  
 wrote:
 Hi all,

 I was trying matplotlib 0.98.0 and Qt4 backend works great but Coca
 backend seems to be broken :

 Charlie,

 any chance you can try and port cocoaagg over to the new trunk api.
 figure.dpi is no longer a lazy value, but a plain ol number.  There
 are probably a few other changes that will need to be made as well.
 I'd like to clear up as many of these problems as we can and shoot for
 a bugfix release next week.

 JDH

Seems like that one little fix did the trick.  I ran several examples  
and haven't had any problems.  Committed now.

- Charlie
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] CocoaAgg backend seems to be broken

2008-06-19 Thread John Hunter
On Thu, Jun 19, 2008 at 9:19 PM, Charles Moad [EMAIL PROTECTED] wrote:

 Seems like that one little fix did the trick.  I ran several examples and
 haven't had any problems.  Committed now.

Thanks Charlie!  Can you provide some basic instructions for those of
us on osx how we can enable and test this backend?

JDH

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Radar / Spider Chars

2008-06-19 Thread Curtis Jensen
No guarantees on when I'll have time, but I'll work on it.

Thanks for the info.

--
Curtis

On Thu, Jun 19, 2008 at 8:17 AM, John Hunter [EMAIL PROTECTED] wrote:
 On Wed, Jun 18, 2008 at 2:43 PM, Curtis Jensen [EMAIL PROTECTED] wrote:
 Nice.  Thanks.  I had tried to do something similar, but kept getting
 a curved line between each data point.
 Also, I too got errors with a previous versions of matplotlib, but 0.98 
 works.

 If someone were willing to add Radar plots to the matplotlib
 functionality, would this be wanted by the users or maintainers?

 Yes, certainly.  You may want to take a look at the polar
 implementation (can you inherit from it?) to reuse as much as
 possible.  Michael has also written a short guide to developers
 working with nonlinear projections

 http://matplotlib.sourceforge.net/doc/html/devel/add_new_projection.html

 JDH


-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users