[Matplotlib-users] Colormaps

2010-03-13 Thread David Arnold
All,

I am having difficulty with a line on:  http://scipy.org/LoktaVolterraTutorial

Here are the lines:

values  = linspace(0.3, 0.9, 5)

vcolors = p.cm.autumn_r(linspace(0.3, 1., len(values)))

First of all, I can find no reference to autumn_r in the Matplotlib 
documentation. Also, using Aptana (eclipse), PyDev complains about the vcolors 
line with:  

Undefined variable from import: autumn_rLotka.py/scipy/src/pkg  
line 44 PyDev Problem

Secondly, I am used to using colormaps in Matlab, but not so  much in 
Matplotlib. In Matlab, g=grey(256) produces an 256x3 matrix and each row is 
indexed by the numbers 1 through 256. Thus, if you have an image and pixel has 
a value 124, then row 124 gives an rgb triple that is used to color the pixel. 

However, in the case of vcolors = p.cm.autumn_r(linspace(0.3, 1., 
len(values))), I'm really not sure what is going on. The 
linspace(0.3,1,len(values)) produces len(values) equally spaced numbers from 
0.3 to 1. Now, how is autumn_r(array([ 0.3  ,  0.475,  0.65 ,  0.825,  1.   ])) 
make any sense?

Thanks.

David.



--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Function in edit box

2010-03-10 Thread David Arnold
All,

Anyone have a small (short) example using Matplotlib and possibly wxPython 
where the user enters a function in an edit box and Matplotlib responds by 
sketching the graph over a domain?

David.
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Doc suggestion

2010-03-09 Thread David Arnold
All,

The linebuilder program on:  
http://matplotlib.sourceforge.net/users/event_handling.html

Needs two extra lines, one at the beginning and one at the end. Their absence, 
particularly the second one, can cause confusion.

import matplotlib.pyplot as plt

class LineBuilder:
def __init__(self, line):
self.line = line
self.xs = list(line.get_xdata())
self.ys = list(line.get_ydata())
self.cid = line.figure.canvas.mpl_connect('button_press_event', self)

def __call__(self, event):
print 'click', event
if event.inaxes!=self.line.axes: return
self.xs.append(event.xdata)
self.ys.append(event.ydata)
self.line.set_data(self.xs, self.ys)
self.line.figure.canvas.draw()

fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title('click to build line segments')
line, = ax.plot([0], [0])  # empty line
linebuilder = LineBuilder(line)

plt.show()

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Working a piece at a time.

2010-03-08 Thread David Arnold
All,

I'm using Aptana (Eclipse) and pydev on a macbook pro. I'm trying to work with 
the following:

http://matplotlib.sourceforge.net/examples/user_interfaces/fourier_demo_wx.html

Now, this is a fairly complicated and interconnected piece of coding. When I am 
trying to learn something, I like to break it down into smaller chunks and 
test, which is much better than trying to type in the whole program (yes, I 
know I can copy and paste, but working a piece at a time is the best way for me 
to learn).

So, can anyone recommend how to test the Param class by itself, then the 
SliderGroup class, etc, then put all the pieces together?

Suggestions at how others work this idea would be very helpful.

David.



--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Traits

2010-03-05 Thread David Arnold
All,

In one post from John Hunter, I heard the word "traits", which I assume is from 
the enthought distribution.

Is there a move in matplotlib toward the "trait" technology taking place? How 
about for Python in general?

Thanks.

David.
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Artist tutorial different response

2010-02-26 Thread David Arnold
All,

On: http://matplotlib.sourceforge.net/users/artists.html

In the Axes Container section, you can see in what follows that I got some very 
different responses than what is shown on the page:

In [1]: fig=figure()

In [3]: ax=fig.add_subplot(111)

In [4]: rect=matplotlib.patches.Rectangle((1,1),width=5,height=12)

In [5]: print rect.get_axes()
--> print(rect.get_axes())
None

In [6]: print rect.get_transform()
--> print(rect.get_transform())
BboxTransformTo(Bbox(array([[  1.,   1.],
   [  6.,  13.]])))

In [7]: ax.add_patch(rect)
Out[7]: 

In [8]: print rect.get_axes()
--> print(rect.get_axes())
Axes(0.125,0.1;0.775x0.8)

In [9]: print rect.get_transform()
--> print(rect.get_transform())
CompositeGenericTransform(BboxTransformTo(Bbox(array([[  1.,   1.],
   [  6.,  13.]]))), 
CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),
 CompositeAffine2D(BboxTransformFrom(TransformedBbox(Bbox(array([[ 0.,  0.],
   [ 1.,  1.]])), 
TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform(), 
BboxTransformTo(TransformedBbox(Bbox(array([[ 0.125,  0.1  ],
   [ 0.9  ,  0.9  ]])), BboxTransformTo(TransformedBbox(Bbox(array([[ 0.,  
0.],
   [ 8.,  6.]])), Affine2D(array([[ 80.,   0.,   0.],
   [  0.,  80.,   0.],
   [  0.,   0.,   1.]])

In [10]: print ax.transData
---> print(ax.transData)
CompositeGenericTransform(TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform())),
 CompositeAffine2D(BboxTransformFrom(TransformedBbox(Bbox(array([[ 0.,  0.],
   [ 1.,  1.]])), 
TransformWrapper(BlendedAffine2D(IdentityTransform(),IdentityTransform(), 
BboxTransformTo(TransformedBbox(Bbox(array([[ 0.125,  0.1  ],
   [ 0.9  ,  0.9  ]])), BboxTransformTo(TransformedBbox(Bbox(array([[ 0.,  
0.],
   [ 8.,  6.]])), Affine2D(array([[ 80.,   0.,   0.],
   [  0.,  80.,   0.],
   [  0.,   0.,   1.]]

In [11]: print ax.get_xlim()
---> print(ax.get_xlim())
(0.0, 1.0)

In [12]: print ax.dataLim.get_bounds()
---> print(ax.dataLim.get_bounds())
---
AttributeErrorTraceback (most recent call last)

/Library/Frameworks/Python.framework/Versions/6.0.0/Examples/matplotlib-0.99.1.1/event_handling/ in ()

AttributeError: 'Bbox' object has no attribute 'get_bounds'

In [13]: ax.autoscale_view()

In [14]: print ax.get_xlim()
---> print(ax.get_xlim())
(1.0, 6.0)

In [15]: ax.figure.canvas.draw()

David.
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Cursor?

2010-02-25 Thread David Arnold
All,

I tried this code from:  
http://matplotlib.sourceforge.net/examples/widgets/cursor.py

from matplotlib.widgets import Cursor
import pylab


fig = pylab.figure(figsize=(8,6))
ax = fig.add_axes([0.075, 0.25, 0.9, 0.725], axisbg='#CC')
#ax = fig.add_subplot(111, axisbg='#CC')
canvas = ax.figure.canvas

x,y = 4*(pylab.rand(2,100)-.5)
ax.plot(x,y,'o')
ax.set_xlim(-2,2)
ax.set_ylim(-2,2)

# set useblit = True on gtkagg for enhanced performance
cursor = Cursor(ax, useblit=True, color='red', linewidth=2 )

pylab.show()

I got this error on my Macbook Pro:

The debugged program raised the exception unhandled AttributeError
"'FigureCanvasMac' object has no attribute 'copy_from_bbox'"

Any suggestions?

David
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mplot3d stays?

2010-02-21 Thread David Arnold
Hi,

What prevents me from using mplot3d in the classroom is highlighted by the 
following example.

# surface3d_demo2.py
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

fig = plt.figure()
ax = Axes3D(fig)

u = np.linspace(0, 2*np.pi, 100)
v = np.linspace(0,  np.pi,  100)

x = 10 * np.outer(np.cos(u), np.sin(v))
y = 10 * np.outer(np.sin(u), np.sin(v))
z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))

ax.plot_surface(x, y, z, rstride=4,  cstride=4, color='b')

yy = np.linspace(-10, 10, 40)
zz = np.linspace(-10, 10, 40)
[yy, zz] = np.meshgrid(yy, zz)
xx = np.ones(np.shape(yy))

ax.plot_surface(xx, yy, zz, rstride=1, cstride=1, color=".7")

ax.set_xlabel('x-axis')
ax.set_ylabel('y-axis')

plt.show()

This code produces the following image:

http://msemac.redwoods.edu/~darnold/junk/test1.png

Pretty much the same code in Matlab:

u=linspace(0,2*pi,40);
v=linspace(0,pi,40);
[u,v]=meshgrid(u,v);
 
x=10*cos(u).*sin(v);
y=10*sin(u).*sin(v);
z=10*cos(v);
 
surf(x,y,z,'FaceColor','b')
 
yy=linspace(-10,10,40);
zz=yy;
[yy,zz]=meshgrid(yy,zz);
xx=ones(size(yy));
 
hold on
 
surf(xx,yy,zz,'FaceColor',[0.7,0.7,0.7])
 
view(30,30)
 
print -dpng 'test2.png'
 
shg


Produces this image:

http://msemac.redwoods.edu/~darnold/junk/test2.png

The inability of mplot3d to determine which image is in front seems to be a 
problem.

The following page (must be viewed in Firefox) will give some sense of what I 
need when teaching multivariable calculus.

http://msemac.redwoods.edu/~darnold/math50c/matlab/index.php

David Arnold
College of the Redwoods
http://msemac.redwoods.edu/~darnold/index.php



Davd Arnold
College of the Redwoods
On Feb 21, 2010, at 2:02 PM, Ben Axelrod wrote:

> I am not a MPL developer, but I am using mplot3d quite heavily right now to 
> support 3D plots for a client of mine.  I have found many bugs and lacking 
> features which I require in the mplot3d library and have modified my local 
> copy of the code significantly.  I am eagerly awaiting Reinier's return from 
> vacation so that I can work with him to integrate my improvements.  For the 
> most part, these fixes simply make the 3D plots behave more like the 2D 
> plots.  Here is a tentative list of my changes so far:
> 
> * bug fix: placement of title in 3D plots to match 2D plot behavior
> * bug fix: allow facecolors and edgecolors to be specified as 'none' in 3D 
> scatter plots to match the 2D scatter plot behavior
> * bug fix: allow all keyword arguments to be used in text3D
> * bug fix: allow an array of colors to be passed into bar3d to specify the 
> colors on a per-bar or per-face basis
> * bug fix: allow all keyword arguments to be used in bar3d
> * bug fix: allow 3d scatter plots with 3 or 4 points with colors specified
> * new feature: new method to disable mouse rotation in 3D plots
> * new feature: new Z-order sorting heuristic to eliminate rendering issues 
> for the common case of using bar3d to visualize a 2D histogram
> * new feature: new method text2D
> * code cleanup: warn when canvas is None which disables mouse callbacks
> * code cleanup: fully document more methods in mplot3d
> 
> Although I haven't written them yet, I can probably create a couple more 
> example codes:
> * example code: demonstrate use of transform() to do rectangle selection in 
> 3D scatter plots
> * example code: mplot3d with wx - demonstrate turning off mouse rotations to 
> make pan and zoom toolbar buttons work properly
> 
> There are a few other bugs that I would really like fixed, but can't quite 
> figure out right now.  Hopefully Reinier will be able to shed some light on 
> these:
> * axis label picking for 3D axes
> * how to set axis tick label properties for 3D axes
> * allow 3d boxes with transparent faces to make "wireframe" boxes
> * fix z-order sorting across multiple calls to bar3d()
> 
> I should note that because of my client, I have a vested interest in seeing 
> mplot3d (with the above bug fixes) make it into a stable release of MPL.  But 
> at the same time, I don't have a lot of spare time to spend on MPL 
> development.
> 
> Thanks,
> -Ben
> 
> 
> From: John Hunter [jdh2...@gmail.com]
> Sent: Sunday, February 21, 2010 12:19 PM
> To: Jakub Nowacki
> Cc: matplotlib-users@lists.sourceforge.net
> Subject: Re: [Matplotlib-users] mplot3d stays?
> 
> On Sun, Feb 21, 2010 at 8:20 AM, Jakub Nowacki
>  wrote:
>> Hi,
>> 
>> I have quite general question. Since mplot3d now back in matplotlib, the 
>> question is: is it going to stay there? Or is it some test release? I was 
>> just wondering cause sometimes I use 3d plotting and use Ma

[Matplotlib-users] Masks

2010-02-17 Thread David Arnold
All,

In the code on:

http://matplotlib.sourceforge.net/examples/api/bbox_intersect.html

I think I've figured out that:

vertices = (np.random.random((4, 2))-0.5)*6.0
vertices = np.ma.masked_array(vertices, [[False, False], [True, True], 
[False, False], [False, False]])

prevents the second of four random vertices from being used. But I'm not sure 
why

plot(vertices[:, 0], vertices[:, 1], color=color)

seems to connect only two points for a line segment.

Can someone explain?

D.
--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Clipping

2010-02-17 Thread David Arnold
All,

I'm looking at:

http://matplotlib.sourceforge.net/examples/api/clippath_demo.html

But I cannot figure out:

patch=patches.Circle((300, 300), radius=100)

Where precisely is (300,300)?

D.

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Where do bugs and document corrections/suggestions get sent?

2010-02-17 Thread David Arnold
All,

Where do bugs and document corrections/suggestions get sent?

David

--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs 
proactively, and fine-tune applications for parallel performance. 
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] agg_buffer_to_array.py

2010-02-15 Thread David Arnold
All,

This error:
The debugged program raised the exception unhandled AttributeError
"'FigureCanvasMac' object has no attribute 'buffer_rgba'"
File: 
/Users/darnold/Documents/temp/Matplotlib/PylabExamples/agg_buffer_to_array.py, 
Line: 16
is raised by the following script on my Macbook.

# agg_buffer_to_array.py
 
import matplotlib
matplotlib.use('macosx')
from pylab import figure, show
import numpy as np

# make an agg figure
fig = figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3])
ax.set_title('a simple figure')
fig.canvas.draw()

# grab rhe pixel buffer and dumpy it into a numpy array
buf = fig.canvas.buffer_rgba(0,0)
l, b, w, h = fig.bbox.bounds
X = np.fromstring(buf, np.uint8)
X.shape = h,w,4

# now display the array X as an Axes in a new figure
fig2 = figure()
ax2 = fig2.add_subplot(111, frameon=False)
ax2.imshow(X)
show()

This is captured from:  
http://matplotlib.sourceforge.net/examples/pylab_examples/agg_buffer_to_array.html

With:

matplotlib.use('Agg')

Nothing happens at all. With --verbose-helpful, yields the following:

$HOME=/Users/darnold
CONFIGDIR=/Users/darnold/.matplotlib
matplotlib data path 
/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data
loaded rc file /Users/darnold/.matplotlib/matplotlibrc
matplotlib version 0.99.1.1
verbose.level helpful
interactive is False
units is False
platform is darwin
Using fontManager instance from /Users/darnold/.matplotlib/fontList.cache
backend agg version v2.2
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
 to Bitstream Vera Sans 
(/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
 with score of 0.00
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=large
 to Bitstream Vera Sans 
(/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
 with score of 0.00

Both

matplotlib.use('tkagg')

and

matplotlib.use('wxagg')

work as they should.

David.--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Enter Figure on Macs

2010-02-14 Thread David Arnold
John,

Only the wxagg worked. Here is the output:

$HOME=/Users/darnold
CONFIGDIR=/Users/darnold/.matplotlib
matplotlib data path 
/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data
loaded rc file /Users/darnold/.matplotlib/matplotlibrc
matplotlib version 0.99.1.1
verbose.level helpful
interactive is False
units is False
platform is darwin
Using fontManager instance from /Users/darnold/.matplotlib/fontList.cache
backend WXAgg version 2.8.10.1
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
 to Bitstream Vera Sans 
(/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
 with score of 0.00
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0
 to Bitstream Vera Sans 
(/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
 with score of 0.00
enter_figure Figure(640x480)
leave_figure Figure(640x480)
enter_figure Figure(640x480)
leave_figure Figure(640x480)
enter_figure Figure(640x480)
leave_figure Figure(640x480)
enter_figure Figure(640x480)
enter_axes Axes(0.125,0.536364;0.775x0.363636)
leave_axes Axes(0.125,0.536364;0.775x0.363636)
enter_axes Axes(0.125,0.1;0.775x0.363636)
leave_axes Axes(0.125,0.1;0.775x0.363636)
leave_figure Figure(640x480)


Did not work with macosx:

$HOME=/Users/darnold
CONFIGDIR=/Users/darnold/.matplotlib
matplotlib data path 
/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data
loaded rc file /Users/darnold/.matplotlib/matplotlibrc
matplotlib version 0.99.1.1
verbose.level helpful
interactive is False
units is False
platform is darwin
Using fontManager instance from /Users/darnold/.matplotlib/fontList.cache
backend MacOSX version unknown
enter_axes Axes(0.125,0.536364;0.775x0.363636)
leave_axes Axes(0.125,0.536364;0.775x0.363636)
enter_axes Axes(0.125,0.1;0.775x0.363636)
leave_axes Axes(0.125,0.1;0.775x0.363636)
enter_axes Axes(0.125,0.1;0.775x0.363636)
leave_axes Axes(0.125,0.1;0.775x0.363636)
enter_axes Axes(0.125,0.536364;0.775x0.363636)
leave_axes Axes(0.125,0.536364;0.775x0.363636)
enter_axes Axes(0.125,0.1;0.775x0.363636)
leave_axes Axes(0.125,0.1;0.775x0.363636)


Did not work with tkagg:

$HOME=/Users/darnold
CONFIGDIR=/Users/darnold/.matplotlib
matplotlib data path 
/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/mpl-data
loaded rc file /Users/darnold/.matplotlib/matplotlibrc
matplotlib version 0.99.1.1
verbose.level helpful
interactive is False
units is False
platform is darwin
Using fontManager instance from /Users/darnold/.matplotlib/fontList.cache
backend TkAgg version 8.4
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
 to Bitstream Vera Sans 
(/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
 with score of 0.00
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=12.0
 to Bitstream Vera Sans 
(/Library/Frameworks/Python.framework/Versions/4.3.0/lib/python2.5/site-packages/matplotlib-0.98.5.2n2-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
 with score of 0.00
enter_axes Axes(0.125,0.536364;0.775x0.363636)
leave_axes Axes(0.125,0.536364;0.775x0.363636)
enter_axes Axes(0.125,0.1;0.775x0.363636)
leave_axes Axes(0.125,0.1;0.775x0.363636)
enter_axes Axes(0.125,0.536364;0.775x0.363636)
leave_axes Axes(0.125,0.536364;0.775x0.363636)
enter_axes Axes(0.125,0.1;0.775x0.363636)
leave_axes Axes(0.125,0.1;0.775x0.363636)



On Feb 14, 2010, at 7:50 PM, John Hunter wrote:

> On Sun, Feb 14, 2010 at 6:53 PM, David Arnold  
> wrote:
>> All,
>> 
>> Any Mac users out there? This script from the User Guide does not seem to 
>> recognize entering or leaving a figure. Any thoughts?
> 
> My Mac is currently dead, but I developed these events while I was a
> mac user and so am pretty sure they worked.  It is more likely a
> specific backend problem than a Mac vs non-Mac problem (eg it may be
> specific to the macosx backend but not a problem for macs in general)
> 
>  http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
> 
> Could you try running the script with the "use" directive at the top
> of your script (before any other mpl code) for different backends, eg
> tkagg vs macosx vs wxagg
> 
>  import matplotlib
>  matplotlib.use('tkagg')  # and also try macosx and wxagg
> 
> so we can see exactly where the problem is arising.  Also, run your

[Matplotlib-users] Easy come easy go

2010-02-14 Thread David Arnold
All,

This example:  
http://matplotlib.sourceforge.net/examples/event_handling/keypress_demo.html

Raises this exception o my Macbook when the key 's' is pressed:

The debugged program raised the exception unhandled TypeError
"save_figure() takes exactly 1 argument (2 given)"
File: 
/Library/Frameworks/Python.framework/Versions/6.0.0/lib/python2.6/site-packages/matplotlib/backend_bases.py,
 Line: 1703

David
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Enter Figure on Macs

2010-02-14 Thread David Arnold
All,

Any Mac users out there? This script from the User Guide does not seem to 
recognize entering or leaving a figure. Any thoughts?

# enterleave.py

import matplotlib.pyplot as plt

def enter_axes(event):
print 'enter_axes', event.inaxes
event.inaxes.patch.set_facecolor('yellow')
event.canvas.draw()

def leave_axes(event):
print 'leave_axes', event.inaxes
event.inaxes.patch.set_facecolor('white')
event.canvas.draw()

def enter_figure(event):
print 'enter_figure', event.canvas.figure
event.canvas.figure.patch.set_facecolor('red')
event.canvas.draw()

def leave_figure(event):
print 'leave_figure', event.canvas.figure
event.canvas.figure.patch.set_facecolor('grey')
event.canvas.draw()

fig1 = plt.figure()
fig1.suptitle('mouse hover over figure or axes to trigger events')
ax1 = fig1.add_subplot(211)
ax2 = fig1.add_subplot(212)

fig1.canvas.mpl_connect('figure_enter_event', enter_figure)
fig1.canvas.mpl_connect('figure_leave_event', leave_figure)
fig1.canvas.mpl_connect('axes_enter_event', enter_axes)
fig1.canvas.mpl_connect('axes_leave_event', leave_axes)

fig2 = plt.figure()
fig2.suptitle('mouse hover over figure or axes to trigger events')
ax1 = fig2.add_subplot(211)
ax2 = fig2.add_subplot(212)

fig2.canvas.mpl_connect('figure_enter_event', enter_figure)
fig2.canvas.mpl_connect('figure_leave_event', leave_figure)
fig2.canvas.mpl_connect('axes_enter_event', enter_axes)
fig2.canvas.mpl_connect('axes_leave_event', leave_axes)

plt.show()

David
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] LineBuilder

2010-02-14 Thread David Arnold
All,

I am curious why this doesn't work:

# linebuilder.py

import matplotlib.pyplot as plt

class LineBuilder:
def __init__(self, line):
self.line=line
self.xs=list(line.get_xdata())
self.ys=list(line.get_ydata())
self.cid=line.figure.canvas.mpl_connect('button_press_event', self)

def __call__(self, event):
print 'click', event
if event.inaxes != self.line.axes:
print event.inaxes
print self.line.axes
return
self.xs.append(event.xdata)
self.ys.append(event.ydata)
self.line.set_data(self.xs, self.ys)
self.line.figure.canvas.draw()

fig=plt.figure()
ax=fig.add_subplot(111)
ax.set_title('click to build line segments')
line, =ax.plot([0], [0])
plt.show()
linebuilder=LineBuilder(line)

However, if I put the plt.show() on the last line, it works. Can anyone explain?

David.
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Python 3

2010-02-14 Thread David Arnold
All,

Can anyone shed light on how python 3 is working together with matplotlib, 
scipy, and numpy?

David
--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] GUI setSizePolicy

2010-02-10 Thread David Arnold
Hi,

I put these lines 


FigureCanvas.setSizePolicy(self,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)

in the following code, but I have not idea what they do as the GUI seems to 
behave equivalently (I can resize easily with the mouse) if they are removed.

Any thoughts?

D.

import sys
from PyQt4 import QtGui
import numpy as np
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as 
NavigationToolbar

class Qt4MplCanvas(FigureCanvas):
def __init__(self):
self.fig = Figure()
self.axes = self.fig.add_subplot(111)
t = np.arange(0.0, 3.0, 0.01)
s = np.cos(2 * np.pi * t)
self.axes.plot(t, s)
FigureCanvas.__init__(self, self.fig)


FigureCanvas.setSizePolicy(self,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding)
FigureCanvas.updateGeometry(self)

qApp = QtGui.QApplication(sys.argv)
fc = Qt4MplCanvas()
fc.show()
sys.exit(qApp.exec_())--
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] clabel manual

2010-02-06 Thread David Arnold
JJ,

Very nice repair, as this works precisely as it should. I use this tool in 
Matlab all the time when teaching multivariable calculus. 

D.

On Feb 6, 2010, at 2:41 PM, Jae-Joon Lee wrote:

> This is a known bug, and I think I fixed it in the svn. Meanwhile, you
> may use the monkey patching.
> Insert these lines in your script (before you call clabel).
> 
> Regards,
> 
> -JJ
> 
> 
> import matplotlib.blocking_input as blocking_input
> def mouse_event_stop(self, event ):
>blocking_input.BlockingInput.pop(self,-1)
>self.fig.canvas.stop_event_loop()
> def add_click(self, event):
>self.button1(event)
> def pop_click(self, event, index=-1):
>if self.inline:
>pass
>else:
>self.cs.pop_label()
>self.cs.ax.figure.canvas.draw()
> 
> blocking_input.BlockingMouseInput.mouse_event_stop = mouse_event_stop
> blocking_input.BlockingMouseInput.add_click = add_click
> blocking_input.BlockingMouseInput.pop_click = pop_click
> 
> 
> 
> On Sat, Feb 6, 2010 at 2:01 AM, David Arnold  
> wrote:
>> Hi,
>> 
>> I'm trying to get manual labeling of contours to work:
>> 
>> import numpy as np
>> import matplotlib.mlab as mlab
>> import matplotlib.pyplot as plt
>> 
>> delta = 0.025
>> x = np.arange(-3.0, 3.0, delta)
>> y = np.arange(-2.0, 2.0, delta)
>> X, Y = np.meshgrid(x, y)
>> Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
>> Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
>> # difference of Gaussians
>> Z = 10.0 * (Z2 - Z1)
>> 
>> plt.figure()
>> CS = plt.contour(X, Y, Z, 6,
>> linewidths=np.arange(.5, 4, .5),
>> colors=('r', 'green', 'blue', (1,1,0), '#af', '0.5')
>> )
>> plt.clabel(CS, fontsize=9, inline=1, manual=True)
>> plt.title('Crazy lines')
>> 
>> plt.show()
>> 
>> On my macbook, clicking with the touchpad does not seem to work.
>> 
>> Any ideas?
>> 
>> David.
>> 
>> --
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Comet

2010-02-06 Thread David Arnold
Goyo,

Sweet little function. Thanks.

I still feel that a comet routine should be added to matplotlib for the reasons 
I've delineated.

D.

On Feb 6, 2010, at 1:38 PM, Goyo wrote:

> Hi David,
> 
> El sáb, 06-02-2010 a las 10:21 -0800, David Arnold escribió:
>> Hi Eric,
>> 
>> Matlab has two commands, comet and comet3, that animate the path. They are 
>> used as in the following Matlab code:
>> 
>> t=linspace(0,2*pi,2000);
>> x=-sin(t);
>> y=cos(t);
>> comet(x,y)
> 
> You can just write the function:
> 
> import matplotlib.pyplot as plt
> 
> def comet(x, y, fmt='', step=1, **kwargs):
>l, = plt.plot(x, y, fmt, **kwargs)
>num_points = len(x)
>for i in xrange(1, num_points + 1, step):
>l.set_data(x[:i], y[:i])
>plt.draw()
>l.set_data(x, y)
>plt.draw()
> 
> I think this could be better done using animation features of
> matplotlib, but I never used them and I think they varies across
> toolkits. Search the docs for animation examples anyway.
> 
> Goyo
> 
>> 
>> What then happens is the path is drawn "live", as in my python code below.
>> 
>> This is especially useful when teaching parametric equations in calculus. A 
>> typical question in that section might be: "find a parametrization for the 
>> unit circle that starts at (0,1) and moves around the circle one time in the 
>> counterclockwise direction." In this situation, the following is not helpful:
>> 
>> t=linspace(0,2*pi,2000);
>> x=-sin(t);
>> y=cos(t);
>> plot(x,y)
>> 
>> Because the student just sees sees the "finished" path. The comet command, 
>> on the other hand, allows the student to "see" that path as it is traced out 
>> in real time.
>> 
>> David.
>> 
>> On Feb 6, 2010, at 9:09 AM, Eric Firing wrote:
>> 
>>> David Arnold wrote:
>>>> All,
>>>> I am still wondering why there is no comet command in matplotlib. I was 
>>>> successful with the following:
>>>> import matplotlib.pyplot as plt
>>>> import numpy as np
>>>> len=200
>>>> t=np.linspace(0,2*np.pi,len)
>>>> x=np.cos(t)
>>>> y=np.sin(t)
>>>> xd=[x[0]]
>>>> yd=[y[0]]
>>>> l,=plt.plot(xd,yd)
>>>> plt.axis([-1,1,-1,1])
>>>> for i in np.arange(1,len):
>>>>xd.append(x[i])
>>>>yd.append(y[i])
>>>>l.set_xdata(xd)
>>>>l.set_ydata(yd)
>>>>plt.draw()
>>>>
>>>> plt.show()
>>>> But it seems that a comet function added to the matplotlib library would 
>>>> greatly simplify things for students using the interactive pylab in 
>>>> ipython.
>>> 
>>> I don't understand--what's the point of the example?  What is "comet", and 
>>> how does it simplify anything?
>>> 
>>> Eric
>>> 
>> 
>> 
>> --
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> 
> --
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Comet

2010-02-06 Thread David Arnold
Hi Eric,

Matlab has two commands, comet and comet3, that animate the path. They are used 
as in the following Matlab code:

t=linspace(0,2*pi,2000);
x=-sin(t);
y=cos(t);
comet(x,y)

What then happens is the path is drawn "live", as in my python code below.

This is especially useful when teaching parametric equations in calculus. A 
typical question in that section might be: "find a parametrization for the unit 
circle that starts at (0,1) and moves around the circle one time in the 
counterclockwise direction." In this situation, the following is not helpful:

t=linspace(0,2*pi,2000);
x=-sin(t);
y=cos(t);
plot(x,y)

Because the student just sees sees the "finished" path. The comet command, on 
the other hand, allows the student to "see" that path as it is traced out in 
real time.

David.

On Feb 6, 2010, at 9:09 AM, Eric Firing wrote:

> David Arnold wrote:
>> All,
>> I am still wondering why there is no comet command in matplotlib. I was 
>> successful with the following:
>> import matplotlib.pyplot as plt
>> import numpy as np
>> len=200
>> t=np.linspace(0,2*np.pi,len)
>> x=np.cos(t)
>> y=np.sin(t)
>> xd=[x[0]]
>> yd=[y[0]]
>> l,=plt.plot(xd,yd)
>> plt.axis([-1,1,-1,1])
>> for i in np.arange(1,len):
>>  xd.append(x[i])
>>  yd.append(y[i])
>>  l.set_xdata(xd)
>>  l.set_ydata(yd)
>>  plt.draw()
>>  
>> plt.show()
>> But it seems that a comet function added to the matplotlib library would 
>> greatly simplify things for students using the interactive pylab in ipython.
> 
> I don't understand--what's the point of the example?  What is "comet", and 
> how does it simplify anything?
> 
> Eric
> 


--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Comet

2010-02-05 Thread David Arnold
All,

I am still wondering why there is no comet command in matplotlib. 

I was successful with the following:

import matplotlib.pyplot as plt
import numpy as np

len=200
t=np.linspace(0,2*np.pi,len)
x=np.cos(t)
y=np.sin(t)
xd=[x[0]]
yd=[y[0]]
l,=plt.plot(xd,yd)
plt.axis([-1,1,-1,1])

for i in np.arange(1,len):
xd.append(x[i])
yd.append(y[i])
l.set_xdata(xd)
l.set_ydata(yd)
plt.draw()

plt.show()


But it seems that a comet function added to the matplotlib library would 
greatly simplify things for students using the interactive pylab in ipython.

Any plans?

David
--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] clabel manual

2010-02-05 Thread David Arnold
Hi,

I'm trying to get manual labeling of contours to work:

import numpy as np
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt

delta = 0.025
x = np.arange(-3.0, 3.0, delta)
y = np.arange(-2.0, 2.0, delta)
X, Y = np.meshgrid(x, y)
Z1 = mlab.bivariate_normal(X, Y, 1.0, 1.0, 0.0, 0.0)
Z2 = mlab.bivariate_normal(X, Y, 1.5, 0.5, 1, 1)
# difference of Gaussians
Z = 10.0 * (Z2 - Z1)

plt.figure()
CS = plt.contour(X, Y, Z, 6,
 linewidths=np.arange(.5, 4, .5),
 colors=('r', 'green', 'blue', (1,1,0), '#af', '0.5')
 )
plt.clabel(CS, fontsize=9, inline=1, manual=True)
plt.title('Crazy lines')

plt.show()

On my macbook, clicking with the touchpad does not seem to work.

Any ideas?

David.

--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Lorenz animation

2010-01-14 Thread David Arnold
All,

I've attached lorenz.m from Matlab. It animates the trajectory of the solution 
of the lorenz system in 3D.

Does anyone have a Matplotlib file that will do something similar?

David.

lorenz.m
Description: Binary data
--
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Tkinter scripts

2010-01-08 Thread David Arnold
All,

Does anyone have some Tkinter scripts using matplotlib they can share? I am 
just starting to learn Tkinter and I could use some examples.

David Arnold
College of the Redwoods
Department of Mathematics
--
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] clear

2009-12-11 Thread David Arnold
All,

In Matlab, if I want to clear my working space of variables, I type:

 >> clear all

How do I do the same thing in Ipython?

D.

--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Surface and Plane

2009-12-09 Thread David Arnold
All,

Here is my first attempt to draw a surface and a plane on the same  
axes using mplot3d.


from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np

fig=plt.figure()
ax = Axes3D(fig)

x=np.linspace(-2,2,40)
y=x
x, y = np.meshgrid(x,y)
z=9-x**2-y**2

ax.plot_surface(x,y,z,rstride=5,cstride=5)

xp=np.linspace(-2,2,40)
zp=np.linspace(0,9,40)
xp, zp=np.meshgrid(xp,zp)
yp=np.ones(xp.shape)

ax.plot_surface(xp,yp,zp)

plt.show()

The difficulty comes when I rotate the axes with the mouse. You cannot  
tell where the correct position of the plane is as you can when  
rotating a similar figure in Matlab. Is this a bug or a feature yet to  
be added? Is there a workaround I am not aware of at this early stage?

David Arnold
College of the Redwoods
Department of Mathematics


--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Axes3D *args **kargs

2009-12-09 Thread David Arnold
All,

Is there a page that explains in full the Axes3D command and exactly  
what can be passed as arguments to Axes3D command?

view?

etc.

Thanks,

David

--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Baseline pngmath

2009-12-07 Thread David Arnold
All,

I tried using sphinx.ext.pngmath. See:  
http://msemac.redwoods.edu/~darnold/html/cylinders.html

Note in Exercise 1 how z = 6 - 2x^2 is placed so its baseline does not  
align (it's lower) with the baseline of the text. How can I align the  
baselines?

David.

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] axis equal

2009-12-07 Thread David Arnold
All,

Is there an "axis equal" command for mplot3d?

D.

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Comet

2009-12-07 Thread David Arnold
All,

Is there anything resembling Matlab's comet command?

D.

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Rotation 3D

2009-12-07 Thread David Arnold
All,

Is there any way to rotate a 3D plot_wireframe?

D.

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3D

2009-12-06 Thread David Arnold
All, I have:

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np

fig=plt.figure()
ax=axes3d.Axes3D(fig)

x=np.linspace(-2,2,40)
y=np.linspace(-2,2,40)

X, Y=np.meshgrid(x,y)
Z=6-2*X**2

ax.plot_wireframe(X,Y,Z)
ax.set_xlabel('x-axis')
ax.set_ylabel('y-axis')
ax.set_zlabel('z-axis')

plt.show()


How can I add a title and rotate the axes?

D.

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Sphinx and ams-latex

2009-12-06 Thread David Arnold
All,

If I am using this in my conf.py in Sphinx:

extensions = ['matplotlib.sphinxext.mathmpl',
'matplotlib.sphinxext.only_directives',
'matplotlib.sphinxext.plot_directive']

Is there a way I can use ams-latex constructs such as:

\begin{align*}
x+2y&=3\\
2x-3y&=4
\end{align*}

D.

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Publish to HTML

2009-12-03 Thread David Arnold
All.

I see the Sphinx tutorial Sampledoc on the Matplotlib site and am  
working through the tutorial. This semester, my students have really  
enjoyed using Matlab's publish to HTML tool, then they upload the  
resulting files to their Drop Box on our Sakai course management system.

I am wondering if Sampledoc type files can be used for this same  
purpose. Is there a way you can gather the output html and upload them  
to our Sakai drop boxes?

David Arnold
College of the Redwoods

--
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] clabel

2008-10-26 Thread David Arnold
Eric et al,

Very nice. However, I am running the latest Enthought EPD on Mac OS X  
10.4.11 and I get this:

In [6]: clabel(cs,inline=1,fontsize=10,manual=True)
Select label locations manually using first mouse button.
End manual selection with second mouse button.
/Library/Frameworks/Python.framework/Versions/4.0.30002/lib/python2.5/ 
site-packages/matplotlib-0.98.3.0001-py2.5-macosx-10.3-fat.egg/ 
matplotlib/backend_bases.py:1448: DeprecationWarning: Using default  
event loop until function specific to this GUI is implemented
   warnings.warn(str,DeprecationWarning)

It works, adding labels whenever I click with my mouse, but I cannot  
end labeling. I've tried various combinations with the mouse (ctrl 
+click, option+click, command+click) and keyboard (Enter), to no avail.

Has anyone tried this on a Mac and got the labeling to end?

Thanks.

D.

On Oct 25, 2008, at 5:21 PM, Eric Firing wrote:

> David Arnold wrote:
>> All,
>> Does Matplotlib have a form of the clabel command that uses the   
>> switch manual, as in Matlab:
>> [c,h]=contour(x,y,z);
>> clabel(c,h,'manual')
>> Which allows the user to pick the contours to label with the mouse?
>
> Yes, this was added recently by David Kaplan.  It is in svn; I  
> don't know whether it has appeared a released version yet.
>
> The relevant part of the docstring, describing the keyword  
> argument, is:
>
>   *manual*:
> if *True*, contour labels will be placed manually using
> mouse clicks.  Click the first button near a contour to
> add a label, click the second button (or potentially both
> mouse buttons at once) to finish adding labels.  The third
> button can be used to remove the last label added, but
> only if labels are not inline.  Alternatively, the keyboard
> can be used to select label locations (enter to end label
> placement, delete or backspace act like the third mouse  
> button,
> and any other key will select a label location).
>
> Eric
>
>> David Arnold
>> College of the Redwoods
>> http://msemac.redwoods.edu/~darnold/index.php
>> - 
>> 
>> This SF.Net email is sponsored by the Moblin Your Move Developer's  
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win  
>> great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in  
>> the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] clabel

2008-10-25 Thread David Arnold
All,

Does Matplotlib have a form of the clabel command that uses the  
switch manual, as in Matlab:

[c,h]=contour(x,y,z);
clabel(c,h,'manual')

Which allows the user to pick the contours to label with the mouse?

David Arnold
College of the Redwoods
http://msemac.redwoods.edu/~darnold/index.php

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Comet

2008-08-14 Thread David Arnold
All,

Does anyone have any code emulating Matlab's comet command?

D.

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Surf, mesh, and friends

2008-07-25 Thread David Arnold
All,

I am aware of the 3d examples at: http://scipy.org/Cookbook/ 
Matplotlib/mplot3D

However, this seems out of date, some examples work, some don't. Are  
there other pointers that show how I can use matplotlib to draw three  
dimensional surfaces similar to the ones drawn in Matlab with mesh,  
surf, and friends?

Any url's appreciated.

Thanks.

David

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users