Re: [Matplotlib-users] Unable to import matplotlib.pylab in Windows

2009-11-22 Thread Christoph Gohlke
Try installing the Microsoft Visual C++ 2008 Redistributable Package (x86)
.
This is usually installed during the installation of Python in the 
"Install For All Users" mode.

Christoph

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Unable to import matplotlib.pylab in Windows

2009-11-22 Thread Dilip Warrier
Hi, all.

I am unable to import matplotlib.pylab. 

When I run the following command:
python -c "import matplotlib.pylab"
the application crashes with a windows error message.

Running with the -v option shows that the application crashes at the following 
stage:
import matplotlib.transforms

>From previous posts on this mailing list, others have encountered similar (but 
>perhaps not quite the same?) problems. I followed some of the advice and 
>downloaded the dependency walker software from 
>http://www.dependencywalker.com. Dependency Walker says that the following 
>DLLs are missing for _path.pyd:
MSVCP90.DLL, MSVCR90.DLL, DWMAPI.DLL, EFSADU.DLL.

(Indeed I tried many .pyd files from C:\Python26\Lib\site-packages\matplotlib 
and all of them gave similar error messages.)

Any idea how I can get these DLLs (they aren't in C:\Windows\System32) or, 
indeed, whether this is the actual solution to the problem?

I have the following versions:

Windows XP Service Pack 2
Python 2.6
Matplotlib 0.99.1

Python and Matplotlib were binaries downloaded from sourceforge.net.

Thanks,
Dilip.


  

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] `fig.subplots_adjust` does not behave as advertized

2009-11-22 Thread Dr. Phillip M. Feldman

The basemap demo `cubed_sphere.py` contains the following line of code:

   fig.subplots_adjust(bottom=0, left=0, right=1, top=0, wspace=0, hspace=0)

>From the documentation, it would appear that `wspace=0` should remove all
horizontal space between the subplots.  But, this isn't what happens.  (I
tried to insert an image, but this feature of Nabble appears to be broken).
-- 
View this message in context: 
http://old.nabble.com/%60fig.subplots_adjust%60-does-not-behave-as-advertized-tp26471386p26471386.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] separate sub-forum for basemap?

2009-11-22 Thread Dr. Phillip M. Feldman

It seems as though there are enough basemap-related posts that it might be
worth creating a separate basemap-specific sub-forum of the matplotlib
forum.
-- 
View this message in context: 
http://old.nabble.com/separate-sub-forum-for-basemap--tp26470932p26470932.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] bug in run_all.py

2009-11-22 Thread Dr. Phillip M. Feldman

The script run_all.py in the basemap examples does not work when Python has
been installed to "C:\Program Files\Python25".  It appears that this problem
involves the space in the path.
-- 
View this message in context: 
http://old.nabble.com/bug-in-run_all.py-tp26470905p26470905.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] set figure position

2009-11-22 Thread Christopher Barker
Laurent Dufrechou wrote:
> You can define exactly the size and position of your plot like this:
> 
> fig = Figure()
> axe = fig.add_axes([pos_x,pos_y,size_x,size_y])

I believe the OP was asking how to position the entire figure Window (or 
frame in wx parlance) on the screen, rather than the axis within the figure.

If you are using the wx back-end, you should be able to get a reference 
to the wx.Frame, and do what you like with it. (sorry, I don't remember 
how to do that off the top of my head, though if need be a few calls to 
GetParent should get you there).

If you are using another back-end there should be a similar calls available.

However, given your description, I suspect that you'd be better off 
managing the frames with your code anyway. Take a look at wxMPL 
(http://agni.phys.iit.edu/~kmcivor/wxmpl/) and/or the "embedded_in_wx" 
examples.


-Chris
> axe.plot(x, y, 'b')
> 
> where pos_x,pos_y is a number (0 size_x, size_x is a number (0 1 is full figure size.
> 
> Ex: axe = fig.add_axes([0.1,0.1,0.8,0.2])
> 
> Plot @10% x,10% y from bottom left
> And size is 80% of figure x size and 20% of figure y size.
> 
> 
> Laurent
> 
> -Message d'origine-
> De : Marie De La Fontaine [mailto:marie.delafonta...@yahoo.com] 
> Envoyé : dimanche 22 novembre 2009 18:05
> À : matplotlib-users@lists.sourceforge.net
> Objet : [Matplotlib-users] set figure position
> 
> We have recently switched to matplotlib after having done all plotting with
> pure wxPython for years.
> 
> There is one problem we cannot solve. With wxPython we are free to set the
> geometry (position and size) of each Frame anywhere on the screen. We have
> developed a heuristic solution which packs the Frames automatically
> according to a pattern that can be recognized after a user has manually
> repositioned a few Frames on the screen. For example, some users tend to
> align their figures in a row, others subdivide the available space for
> different groups of figures, and so on. Please let us know if anyone is
> interested to integrate this heuristic packing into matplotlib.
> 
> The important question is:
> How can we set the position of a Figure on the screen using matplotlib?
> There is a function Figure.set_size_inches, but no function to move the
> Figure to a new position. Please help.
> 
> Regards,
> Marie
> 
> 
> __
> Do You Yahoo!?
> Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
> gegen Massenmails. 
> http://mail.yahoo.com 
> 
> 
> 
> --
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus
> on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 
> --
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-- 
Christopher Barker, Ph.D.
Oceanographer

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

chris.bar...@noaa.gov


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] set figure position

2009-11-22 Thread Laurent Dufrechou
Hi marie,

You can define exactly the size and position of your plot like this:

fig = Figure()
axe = fig.add_axes([pos_x,pos_y,size_x,size_y])
axe.plot(x, y, 'b')

where pos_x,pos_y is a number (0mailto:marie.delafonta...@yahoo.com] 
Envoyé : dimanche 22 novembre 2009 18:05
À : matplotlib-users@lists.sourceforge.net
Objet : [Matplotlib-users] set figure position

We have recently switched to matplotlib after having done all plotting with
pure wxPython for years.

There is one problem we cannot solve. With wxPython we are free to set the
geometry (position and size) of each Frame anywhere on the screen. We have
developed a heuristic solution which packs the Frames automatically
according to a pattern that can be recognized after a user has manually
repositioned a few Frames on the screen. For example, some users tend to
align their figures in a row, others subdivide the available space for
different groups of figures, and so on. Please let us know if anyone is
interested to integrate this heuristic packing into matplotlib.

The important question is:
How can we set the position of a Figure on the screen using matplotlib?
There is a function Figure.set_size_inches, but no function to move the
Figure to a new position. Please help.

Regards,
Marie


__
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz
gegen Massenmails. 
http://mail.yahoo.com 



--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus
on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] quiver without any scaling

2009-11-22 Thread Xavier Gnata
Hi,

RTFM...indeed it works.
However, the axis do not scale accordingly:

quiver([1],[1],[2],[2], angles='xy', scale_units='xy', scale=1) on a 
TkAgg backend produce a plot with:
In [11]: axis()
Out[11]:
(0.94006,
  1.0601,
  0.94006,
  1.0601)

The display area scales the same way as it does using 
quiver([1],[1],[2],[2]) (without any other args).
It looks like a bug.

Xavier


> Hi Xavier,
>
> You can pass some handy keyword arguments to fix that. Use the following:
>
> quiver([1],[1],[1.2],[1.2], angles='xy', scale_units='xy', scale=1)
>
> Hope that helps :)
>
>
> Regards,
> -- Damon
>
> --
> Damon McDougall
> Mathematics Institute
> University of Warwick
> Coventry
> CV4 7AL
> d.mcdoug...@warwick.ac.uk
>
> On 22 Nov 2009, at 16:37, Xavier Gnata wrote:
>
>
>> Hi,
>>
>> I woud like to draw a vector field using pylab.
>> quivert looks nice but it sould not scale the arrows to fit my use-case.
>> quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the
>> arrow is not at (1.2,1.2).
>> Is there a way to plot a list of arrows *without* any scaling?
>>
>> Xavier
>>
>> --
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
>> trial. Simplify your report design, integration and deployment - and focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>  
>


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] quiver without any scaling

2009-11-22 Thread Damon McDougall
Hi Xavier,

You can pass some handy keyword arguments to fix that. Use the following:

quiver([1],[1],[1.2],[1.2], angles='xy', scale_units='xy', scale=1)

Hope that helps :)


Regards,
-- Damon

--
Damon McDougall
Mathematics Institute
University of Warwick
Coventry
CV4 7AL
d.mcdoug...@warwick.ac.uk

On 22 Nov 2009, at 16:37, Xavier Gnata wrote:

> Hi,
> 
> I woud like to draw a vector field using pylab.
> quivert looks nice but it sould not scale the arrows to fit my use-case.
> quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the 
> arrow is not at (1.2,1.2).
> Is there a way to plot a list of arrows *without* any scaling?
> 
> Xavier
> 
> --
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
> trial. Simplify your report design, integration and deployment - and focus on 
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] set figure position

2009-11-22 Thread Marie De La Fontaine
We have recently switched to matplotlib after having done all plotting with 
pure wxPython for years.

There is one problem we cannot solve. With wxPython we are free to set the 
geometry (position and size) of each Frame anywhere on the screen. We have 
developed a heuristic solution which packs the Frames automatically according 
to a pattern that can be recognized after a user has manually repositioned a 
few Frames on the screen. For example, some users tend to align their figures 
in a row, others subdivide the available space for different groups of figures, 
and so on. Please let us know if anyone is interested to integrate this 
heuristic packing into matplotlib.

The important question is:
How can we set the position of a Figure on the screen using matplotlib? There 
is a function Figure.set_size_inches, but no function to move the Figure to a 
new position. Please help.

Regards,
Marie


__
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen 
Massenmails. 
http://mail.yahoo.com 


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] quiver without any scaling

2009-11-22 Thread Xavier Gnata
Hi,

I woud like to draw a vector field using pylab.
quivert looks nice but it sould not scale the arrows to fit my use-case.
quiver([1],[1],[1.2],[1.2]) does plot a nice arrow but the head of the 
arrow is not at (1.2,1.2).
Is there a way to plot a list of arrows *without* any scaling?

Xavier

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] adjusting space between axes label and axes

2009-11-22 Thread per freem
Hi Jae-Joon and others,

i switched to using splines, but i still cannot see how to adjust the
space between the axis labels and the ticks of the axes. right now the
labels are too far away.

here is my code:

fig = plt.figure()

x = np.linspace(0,2*np.pi,100)
y = 2*np.sin(x)

ax = fig.add_subplot(2,2,1)
ax.plot(x,y)
show_spines(ax,['left', 'bottom'])
plt.xlabel('xlabel')
plt.ylabel('ylabel')

ax = fig.add_subplot(2,2,2)
ax.plot(x,y)
show_spines(ax,['left', 'bottom'])
plt.xlabel('xlabel')
plt.ylabel('ylabel')

ax = fig.add_subplot(2,2,3)
ax.plot(x,y)
show_spines(ax,['left','bottom'])
plt.xlabel('xlabel')
plt.ylabel('ylabel')

ax = fig.add_subplot(2,2,4)
ax.plot(x,y)
show_spines(ax,['left', 'bottom'])
plt.xlabel('xlabel')
plt.ylabel('ylabel')
plt.savefig('test.pdf')

i don't see how i could switch to plt.text or plt.annotate here. the
xlabel and ylabel functions automatically plot the label of an axis in
the center, which is exactly what i need. computing where the
coordinates where a label should be plotted with plt.text so that the
label appears in the center seems very messy and difficult, since it
requires knowing how much space the label will take (and that depends
on the font size etc.)

is there an existing parameter that just controls the distance between
the xticks and the label? it seems like there must be.. i just want to
bring them closer together.

thank you.

On 11/13/09, Jae-Joon Lee  wrote:
> I think I have said this a few times, but if you're using axes_grid
> toolkit, it is likely that most of the ticks, ticklabels and
> axis-related command of the original matplotlib may NOT work. And that
> is why I recommend you to use the spines  instead.
>
> Anyhow, adjusting the pad between axis and the axis label in the
> axes_grid toolkit way is
>
> ax.axis["xzero"].LABELPAD=10
>
> Things like "labelpad" parameters in xlabel (or ylabel) command are
> currently ignored.
>
> I don't think set_position command will work also. I f you need to
> place your labels at some specific point, simply use "text" or
> "annotate" command instead.
>
> -JJ
>
>
>
> On Fri, Nov 13, 2009 at 2:02 PM, per freem  wrote:
>> thanks for the suggestion, though this does not work for me in the
>> following example:
>>
>> import matplotlib
>> matplotlib.use('PDF')
>> import matplotlib.pyplot as plt
>> from matplotlib import rc
>> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
>> plt.rcParams['ps.useafm'] = True
>> rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
>> plt.rcParams['pdf.fonttype'] = 42
>> plt.rcParams['font.size'] = 10
>>
>> from mpl_toolkits.axes_grid.axislines import SubplotZero
>>
>> def setup_axes(fig, labelpad=1, invisible=["bottom", "top", "right"]):
>>    plt.rcParams['ytick.major.pad'] = 2
>>    plt.rcParams['ytick.minor.pad'] = 2
>>    # Y ticks work, but X tick do not...
>>    plt.rcParams['xtick.major.pad'] = 0.01
>>    plt.rcParams['xtick.minor.pad'] = 0.01
>>    ax = SubplotZero(fig, 1, 1, 1)
>>    fig.add_subplot(ax)
>>    # make xzero axis (horizontal axis line through y=0) visible.
>>    ax.axis["xzero"].set_visible(True)
>>    # make other axis (bottom, top, right) invisible.
>>    for n in invisible:
>>        ax.axis[n].set_visible(False)
>>    return ax
>>
>> fig = plt.figure(figsize=(5, 5), dpi=300)
>> setup_axes(fig, labelpad=2)
>> x = range(1, 11)
>> y = [5000, 900, 600, 500, 200, 110, 50, 20, 10, 5]
>> plt.plot(x, y, linewidth=1.5, c='k')
>> plt.ylabel('hello', labelpad=10)
>> xlab = plt.xlabel('hello x axis')
>> xlab.set_position((0.2, 0.1))
>> plt.savefig('test_logscale.pdf')
>>
>> the xaxis doesn't seem to be moved. any idea what might be wrong here?
>>  thanks.
>>
>> On Fri, Nov 13, 2009 at 1:43 PM, Gökhan Sever 
>> wrote:
>>>
>>>
>>> On Fri, Nov 13, 2009 at 12:36 PM, per freem  wrote:

 hi all,

 how can the space between the label (e.g. thing created by
 plt.xlabel('mylabel')) and the axes be adjusted? i am not talking
 about the space between the ticklabels of the axes and the axes
 themselves (which is set by 'xtick.major.pad' or 'ytick.major.pad')
 but between the overall axes label and the axes.

 how can this be done?  thanks.

>>>
>>> Using the set_position method, e.g. :
>>>
>>> xlab = plt.xlabel("my x-axes label")
>>> xlab.set_position((0.2, 0.1))
>>>


 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008
 30-Day
 trial. Simplify your report design, integration and deployment - and
 focus
 on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>
>>>
>>> --
>>> Gökhan
>>>
>>
>> -