[Matplotlib-users] Formatting X-axis

2010-05-17 Thread rajtendulkar

I want to format my graph as in MS-Excel. I don't know what term to use for
this.
It looks like the X-axis has 2 labels on them.
http://old.nabble.com/file/p28579609/omp_parallel.png 

I have showed it in the image that is generated from Excel. I want to have
exactly the same 
using matplotlib.

Can anyone tell me how exactly this can be achieved?

Thanks !
Raj.
-- 
View this message in context: 
http://old.nabble.com/Formatting-X-axis-tp28579609p28579609.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] crop white space of image

2010-05-17 Thread Ruben Moor
Hello,

I plot views of 3D data without axis. The plotting results usually in plenty
of surrounding white space. Is there an easy way to get rid of it (easy
meaning without having to keep track of the spacial extension of my 3D data)
?

Thanks in advance,
Ruben
--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Formatting numbers with exponent with matplotlib

2010-05-17 Thread Darren Dale
On Mon, May 17, 2010 at 6:04 AM, Ralph Kube ralphk...@googlemail.com wrote:
 Hello folks.
 I am trying to teach pylab to use latex to write numbers with an
 exponent in the plot legend.
 So far my plot labels are formatted with scientific notation, where
 I use the format operate:

 import pylab
 ra_list,b = data
 pylab.plot(ra_list,b, label='Ra = ' + {0:4.2e}.format(ra_list[i]))
 pylab.legend()
 pylab.show()

 What I ultimately want is that the exponent shows up as an exponent,
 a la LaTeX style in the legend: $\mathrm{Ra} = 10^6$.

 Does anybody know of a way how to do this with pylab?

I suggest having a look at the ScalarFormatter classer in ticker.py.
The feature you are looking for has already been implemented there.

Darren

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Licence Question

2010-05-17 Thread Craig Lyndon
Hi All,

Im new to matplotlib, and I love it, but I have a question about the
Licence agreement.
I am wanting to develop a commercial closed source application for my
company using python and matplotlib.

I have tried reading the Licence agreement, but have trouble understanding it.
Could someone please tell me under what conditions I can use
matplotlib in a closed source application?

Kind Regards,
Craig

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Licence Question

2010-05-17 Thread John Hunter
On Mon, May 17, 2010 at 8:28 AM, Craig Lyndon c.a.lyn...@gmail.com wrote:
 Hi All,

 Im new to matplotlib, and I love it, but I have a question about the
 Licence agreement.
 I am wanting to develop a commercial closed source application for my
 company using python and matplotlib.

 I have tried reading the Licence agreement, but have trouble understanding it.
 Could someone please tell me under what conditions I can use
 matplotlib in a closed source application?

The license itself is the ultimate reference, but in a nutshell, you
are free to use matplotlib in a commercial, closed source application.
 The only clause that could potentially require action from you is
that if you *modify* matplotlib and want to distribute it for others,
you need to summarize  the changes you made (clause 3).

If you end up making a lot of money, remember us on the donations page :-)

http://sourceforge.net/project/project_donations.php?group_id=80706

JDH

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] imshow memory problem

2010-05-17 Thread Tomáš Faragó
Hello,
I am writing a GUI using GTK+ library. I have a question about axes class 
imshow method memory consumtion. If I pass the imshow an array, the resulting 
memory consuption is approximatelly 46 times greater than the array size. If I 
do not add the canvas to a window (in a code below), the memory consuption is 
only 8 times greater. Any tips on how to reduce the memory consuption would 
be very appreciated and any explanation of how much memmory imshow allocates 
too. Configuration and script are below.

os: Windowx XP
matplotlib version: 0.99.1
downloaded from: sourceforge.net

script:
from matplotlib.figure import Figure
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
from pylab import rand
import gtk

window = gtk.Window()
window.connect(destroy, gtk.main_quit)

figure = Figure(figsize=(8,6), dpi=72)
canvas = FigureCanvasGTKAgg(figure)
axes = figure.add_subplot(111)

window.add(canvas)

axes.imshow(rand(1024,1024))
canvas.draw()
window.show_all()

gtk.main()

verbose-helpful output:
$HOME=C:\Documents and Settings\Sensej
CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
matplotlib data path C:\Python26\lib\site-packages\matplotlib\mpl-data
loaded rc file C:\Python26\lib\site-packages\matplotlib\mpl-data\matplotlibrc
matplotlib version 0.99.1
verbose.level helpful
interactive is False
units is False
platform is win32
Using fontManager instance from C:\Documents and 
Settings\Sensej\.matplotlib\fontList.cache
backend GTKAgg version 2.12.1
findfont: Matching 
:family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
 to Bitstream Vera Sans 
(C:\Python26\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf) with 
score of 0.00

Thank you,
Tomas.

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory problem

2010-05-17 Thread Michael Droettboom
On Linux, I only see about an extra 24kb being used when the canvas is 
added to a window vs. not adding it (i.e. commenting out the 
window.add(canvas) line).

In general, here's the memory usage to be expected from imshow (if it's 
a floating-point, not-rgb(a) array as you have here):

The original data: 4-bytes-per-pixel for float32 or 8-bytes-per-pixel 
for float64 (in your example the array is float64).
Intermediate float data: *if* the original is not float64, then an 
intermediate float64 is created (not the case here)
The colorized data: 4-bytes-per-pixel at original array size
The sized data: 4-bytes-per-pixel at the scaled figure size

I hope I'm not forgetting anything, but the point is that to support 
high-speed rendering of plots, the memory usage is much greater than the 
data itself.  If your data is truly large, the usual technique is to 
decimate or downsample it before passing it to matplotlib, as you're not 
going to see more data points than pixels on your display anyway.

Mike

Tomáš Faragó wrote:
 Hello,
 I am writing a GUI using GTK+ library. I have a question about axes class 
 imshow method memory consumtion. If I pass the imshow an array, the resulting 
 memory consuption is approximatelly 46 times greater than the array size. If 
 I do not add the canvas to a window (in a code below), the memory consuption 
 is only 8 times greater. Any tips on how to reduce the memory consuption 
 would be very appreciated and any explanation of how much memmory imshow 
 allocates too. Configuration and script are below.

 os: Windowx XP
 matplotlib version: 0.99.1
 downloaded from: sourceforge.net

 script:
 from matplotlib.figure import Figure
 from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
 from pylab import rand
 import gtk

 window = gtk.Window()
 window.connect(destroy, gtk.main_quit)

 figure = Figure(figsize=(8,6), dpi=72)
 canvas = FigureCanvasGTKAgg(figure)
 axes = figure.add_subplot(111)

 window.add(canvas)

 axes.imshow(rand(1024,1024))
 canvas.draw()
 window.show_all()

 gtk.main()

 verbose-helpful output:
 $HOME=C:\Documents and Settings\Sensej
 CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
 matplotlib data path C:\Python26\lib\site-packages\matplotlib\mpl-data
 loaded rc file C:\Python26\lib\site-packages\matplotlib\mpl-data\matplotlibrc
 matplotlib version 0.99.1
 verbose.level helpful
 interactive is False
 units is False
 platform is win32
 Using fontManager instance from C:\Documents and 
 Settings\Sensej\.matplotlib\fontList.cache
 backend GTKAgg version 2.12.1
 findfont: Matching 
 :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
  to Bitstream Vera Sans 
 (C:\Python26\lib\site-packages\matplotlib\mpl-data\fonts\ttf\Vera.ttf) with 
 score of 0.00

 Thank you,
 Tomas.

 --

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   

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


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] align title of subplot with ylabel

2010-05-17 Thread hettling
Dear all,

I'm struggling with the following problem plotting my data:

I have a figure with two panels next to each other, which I want to
label 'A' and 'B'. I want to left-justify my panel labels, but not to
the box that contains the plot, but to the y-axis label. I played around
with 'text()' and 'title()', but did not find a good solution except for
giving the coordinates manually to 'text()'. This would be very
inconvenient though, because I have many different plots on different
scales.
Here is what I tried:

###Code
import scipy
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(121)
plt.plot(scipy.sin(scipy.arange(1,100, 0.001)))
plt.xlabel('xlabel')
plt.ylabel(ylabel)
plt.text(0,1,A, fontsize=14, transform=ax.transAxes)  

ax = fig.add_subplot(122)
plt.plot(scipy.cos(scipy.arange(1,100, 0.001)))
plt.text(0,1,B, fontsize=14, transform=ax.transAxes)
plt.xlabel('xlabel')
###End Code

So the texts 'A' and 'B' should be a little bit higher and more to the
left. The 'A' I want to align with the y-axis label of the left plot,
the 'B' with the values of the y-axis of the right plot. 

I hope my question is clear, I will appreciate any help!

Thanks in advance,

Hannes 


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] FW: Matplotlib-users Digest, Vol 48, Issue 19

2010-05-17 Thread Michael Droettboom
Personally, I don't use Wingware, so I don't know any specifics about 
using matplotlib in that environment.  You could try asking this 
question on a Wingware-related mailing list.

Mike

Sandy Ydnas wrote:

  
  Hello friends,
  
 no body can answer on first obvious question of Matplotlib???!

  
 Sandy
  

  From: matplotlib-users-requ...@lists.sourceforge.net
  Subject: Matplotlib-users Digest, Vol 48, Issue 19
  To: matplotlib-users@lists.sourceforge.net
  Date: Thu, 13 May 2010 18:18:52 +
 
  Send Matplotlib-users mailing list submissions to
  matplotlib-users@lists.sourceforge.net
 
  To subscribe or unsubscribe via the World Wide Web, visit
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  or, via email, send a message with subject or body 'help' to
  matplotlib-users-requ...@lists.sourceforge.net
 
  You can reach the person managing the list at
  matplotlib-users-ow...@lists.sourceforge.net
 
  When replying, please edit your Subject line so it is more specific
  than Re: Contents of Matplotlib-users digest...
 
 
  Today's Topics:
 
  1. debugging process gets stuck with matpltlib after show()
  (Sandy Sandy)
 
 
  --
 
  Message: 1
  Date: Thu, 13 May 2010 23:18:42 +0500
  From: Sandy Sandy c...@live.com
  Subject: [Matplotlib-users] debugging process gets stuck with
  matpltlib after show()
  To: matplotlib-users@lists.sourceforge.net
  Message-ID: col116-w25ccfebc9e60e3970a7475f2...@phx.gbl
  Content-Type: text/plain; charset=windows-1252
 
 
 
 
  Hi all,
  I am new born in Python ( 1 week old)
 
 
 
  Can you pls help to understand the basic concept of
  matpltlib interacting with Python
 
 
 
  the mutter is:
 
  during debugging the debug processes stacks when fig is created
 
  for example, in code
 
 
 
 
 
  import matplotlib.pyplot as plt
 
  from pylab import *
 
  x= 23;
 
  y = 11;
 
  print(23456)
 
  plt.plot(range(10))
 
  plot([1,2,3])
 
  show()
 
  print()
 
  a=888
 
 
 
  it is impossible after show() to continue debug in any IDE for 
 example Wingwar
  or pythonxy
 
  as stated in
 
  Beginning Python Visualization - Crafting Visual Transformation 
 Scripts (2009)
 
  page 187
 
 
 
  Note If you?re not using matplotlib interactively in Python, be sure
 
  to call the function show() after all
 
  graphs have been generated, as it enters a user interface main loop
 
  that will stop execution of the rest of
 
  your code. The reason behind this behavior is that matplotlib is
 
  designed to be embedded in a GUI as well.
 
  In Windows, if you?re working from interactive Python, you need only
 
  issue show() once; close the figures
 
  (or figures) to return to the shell. Subsequent plots will be drawn
 
  automatically without issuing show(), and
 
  you?ll be able to plot graphs interactively.
 
 
 
 
 
 
 
 
 
  I tried the code
 
 
 
 
 
  with threads
 
  as suggested in
 
  http://matplotlib.sourceforge.net/users/shell.html
 
 
 
  code
  taken from people
  from wingware
 
  http://www.wingware.com/doc/howtos/matplotlib
 
 
 
 
 
  from threading import Timer
 
  t = Timer(0, show)
 
  t.start()
 
 
 
  but still debugging process gets
  stuck...
 
 
  import
  matplotlib as mpl
 
  from
  pylab import plot,show,close,ion
 
  x
  = range(10)
 
  plot(x)
 
  'show()'
 
  from
  threading import Timer
 
  t
  = Timer(0, show)
 
  t.start()
 
  'ion()
  the same result with or not'
 
  a
  = 133
 
  y
  = [2, 8, 3, 9, 4]
 
  plot(y)
 
 
 
  zz=
  12346
 
  print(4)
 
 
 
  Best Regards
 
  Sandy
 
 
  _
  Hotmail: Trusted email with Microsoft?s powerful SPAM protection.
  https://signup.live.com/signup.aspx?id=60969
  -- next part --
  An HTML attachment was scrubbed...
 
  --
 
  
 --
 
 
 
  --
 
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 
  End of Matplotlib-users Digest, Vol 48, Issue 19
  

 
 Hotmail: Powerful Free email with security by Microsoft. Get it now. 
 https://signup.live.com/signup.aspx?id=60969
 

 --

   
 

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
   

-- 
Michael Droettboom
Science Software Branch

Re: [Matplotlib-users] Matplotlib-users Digest, Vol 48, Issue 23

2010-05-17 Thread Sandy Ydnas

 

Mike,

 

Wingware is only example that commerciale soft can not solv ethis problem never,

 

it gets stuck in all tested by me IDE inclusing Komodo,pythonxy,...

 

 

is is general problem if Matplotlib even staertd in book as I mentined 
previoulsy 

 

it is impossible after show() to continue debug in IDE's  for 
   example wingware or pythonxy as stated in Beginning Python 
   Visualization - Crafting Visual Transformation Scripts
   (2009)
   page  187
   
   Note If you're not using matplotlib interactively in Python, be 
   sure to call the function show() after all graphs have been 
   generated, as it enters a user interface main loop that will stop 
   execution of the rest of your code. The reason behind this 
   behavior is that matplotlib is designed to be embedded in a GUI as 
   well.
   In Windows, if you're working from interactive Python, you need 
   only issue show() once; close the figures (or figures) to return 
   to the shell. Subsequent plots will be drawn automatically without 
   issuing show(), and you'll be able to plot graphs interactively.
   

 

 

 

but no one IDE uses ipython

Sandy

 

 

 Personally, I don't use Wingware, so I don't know any specifics about 
 using matplotlib in that environment. You could try asking this 
 question on a Wingware-related mailing list.
 
 Mike

 
 From: matplotlib-users-requ...@lists.sourceforge.net
 Subject: Matplotlib-users Digest, Vol 48, Issue 23
 To: matplotlib-users@lists.sourceforge.net
 Date: Mon, 17 May 2010 15:06:07 +
 
 Send Matplotlib-users mailing list submissions to
 matplotlib-users@lists.sourceforge.net
 
 To subscribe or unsubscribe via the World Wide Web, visit
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 or, via email, send a message with subject or body 'help' to
 matplotlib-users-requ...@lists.sourceforge.net
 
 You can reach the person managing the list at
 matplotlib-users-ow...@lists.sourceforge.net
 
 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Matplotlib-users digest...
 
 
 Today's Topics:
 
 1. Re: imshow memory problem (Michael Droettboom)
 2. FW: Matplotlib-users Digest, Vol 48, Issue 19 (Sandy Ydnas)
 3. align title of subplot with ylabel (hettling)
 4. Re: FW: Matplotlib-users Digest, Vol 48, Issue 19
 (Michael Droettboom)
 
 
 --
 
 Message: 1
 Date: Mon, 17 May 2010 10:47:41 -0400
 From: Michael Droettboom md...@stsci.edu
 Subject: Re: [Matplotlib-users] imshow memory problem
 To: Tom?? Farag? sensej...@email.cz
 Cc: matplotlib-users@lists.sourceforge.net
 Message-ID: 4bf1570d.40...@stsci.edu
 Content-Type: text/plain; charset=windows-1252; format=flowed
 
 On Linux, I only see about an extra 24kb being used when the canvas is 
 added to a window vs. not adding it (i.e. commenting out the 
 window.add(canvas) line).
 
 In general, here's the memory usage to be expected from imshow (if it's 
 a floating-point, not-rgb(a) array as you have here):
 
 The original data: 4-bytes-per-pixel for float32 or 8-bytes-per-pixel 
 for float64 (in your example the array is float64).
 Intermediate float data: *if* the original is not float64, then an 
 intermediate float64 is created (not the case here)
 The colorized data: 4-bytes-per-pixel at original array size
 The sized data: 4-bytes-per-pixel at the scaled figure size
 
 I hope I'm not forgetting anything, but the point is that to support 
 high-speed rendering of plots, the memory usage is much greater than the 
 data itself. If your data is truly large, the usual technique is to 
 decimate or downsample it before passing it to matplotlib, as you're not 
 going to see more data points than pixels on your display anyway.
 
 Mike
 
 Tom?? Farag? wrote:
  Hello,
  I am writing a GUI using GTK+ library. I have a question about axes class 
  imshow method memory consumtion. If I pass the imshow an array, the 
  resulting memory consuption is approximatelly 46 times greater than the 
  array size. If I do not add the canvas to a window (in a code below), the 
  memory consuption is only 8 times greater. Any tips on how to reduce the 
  memory consuption would be very appreciated and any explanation of how much 
  memmory imshow allocates too. Configuration and script are below.
 
  os: Windowx XP
  matplotlib version: 0.99.1
  downloaded from: sourceforge.net
 
  script:
  from matplotlib.figure import Figure
  from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg
  from pylab import rand
  import gtk
 
  window = gtk.Window()
  window.connect(destroy, gtk.main_quit)
 
  figure = Figure(figsize=(8,6), dpi=72)
  canvas = FigureCanvasGTKAgg(figure)
  axes = figure.add_subplot(111)
 
  window.add(canvas)
 
  axes.imshow(rand(1024,1024))
  canvas.draw()
  window.show_all()
 
  gtk.main()
 
  verbose-helpful output:
  $HOME=C:\Documents and Settings\Sensej
  CONFIGDIR=C:\Documents and Settings\Sensej\.matplotlib
  

Re: [Matplotlib-users] Matplotlib-users Digest, Vol 48, Issue 23

2010-05-17 Thread John Hunter
 Wingware is only example that commerciale soft can not solve this problem
 never,

What does

   matplotlib.get_backend()

report?  According to http://www.wingware.com/doc/howtos/matplotlib
they are assuming TkAgg.  You may also want to read the suggestions at

  http://matplotlib.sourceforge.net/users/shell.html

for advice on how to use matplotlib interactively from the command
shell in an IDE.  Basically, you need to make sure your backend
corresponds to the GUI and interactive mode is set to True.  See also

  http://matplotlib.sourceforge.net/users/customizing.html
  http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend

JDH

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Formatting X-axis

2010-05-17 Thread rajtendulkar

Is there any API to draw the lines between the labels?
I guess its not possible with this tool.
-- 
View this message in context: 
http://old.nabble.com/Formatting-X-axis-tp28579609p28585415.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] pcolor shading=interp change interpolation method?

2010-05-17 Thread Reckoner
Hi,

Using the following

 pcolor(x,y,z,shading='interp')

is it possible to change the interpolation method used? I noticed that there
are set_interpolation methods for images created using

In [83]: h = imshow( z)

In [84]: h.set_interpolation?
Type:   instancemethod
Base Class: type 'instancemethod'
String Form:bound method AxesImage.set_interpolation of
matplotlib.image.AxesImage object at 0x047B27D0
Namespace:  Interactive
File:   c:\python26\lib\site-packages\matplotlib\image.py
Definition: h.set_interpolation(self, s)
Docstring:
Set the interpolation method the image uses when resizing.

ACCEPTS: ['nearest' | 'bilinear' | 'bicubic' | 'spline16' |
  'spline36' | 'hanning' | 'hamming' | 'hermite' | 'kaiser' |
  'quadric' | 'catrom' | 'gaussian' | 'bessel' | 'mitchell' |
  'sinc' | 'lanczos' | ]

are these available for pcolor?

Thanks!
--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Formatting X-axis

2010-05-17 Thread Malte Dik
Hi,

 Is there any API to draw the lines between the labels?
 I guess its not possible with this tool.

You could use the ticks' properties (one of their children is a 
matplotlib.lines.Line2D instance which you could modify to your wishes). The 
second possibility is see is you put a box with only two drawn borders around 
the labels, which I think might lead to problems.

So if you want to inspect, what you can do with those ticks you can use

pyplot.getp(object_to_inspect) and pyplot.setp(object_to_inspect) aswell as
dir(object_to_inspect).

I mostly do this by having an open python shell where I create and check out 
the properties I want to work on and a little script I modify to check out how 
the changes affect the plot. What I did looked something like this:

 from matplotlib import pyplot
 fig = pyplot.figure()
 p = fig.add_subplot(111)
 p.yaxis.set_ticks([3,4,5]) 
[matplotlib.axis.YTick object at 0xa3b580c, matplotlib.axis.YTick object at 
0xa6861cc, matplotlib.axis.YTick object at 0xa6a858c]
 m = p.yaxis.set_ticks([3,4,5])
 dir(m[0])
['__class__', '__d..., 'get_children', 'get_cli...]
 pyplot.getp(m[0])
alpha = 1.0
...
children = [matplotlib.lines.Line2D object at 0xa3b5fac, m...
...
 m[0].get_children()
 pyplot.getp(m[0].get_children()[0])
 pyplot.setp(m[0].get_children()[0])

and if you don't have the return of creating the ticks (m in this case) then 
you can get then using
 p.yaxis.get_children()
[matplotlib.text.Text object at 0xaa80a6c, matplotlib.axis.YTick object at 
0xaa9494c, matplotlib.axis.YTick object at 0xaa80a0c, 
matplotlib.axis.YTick object at 0xaab650c, matplotlib.axis.YTick object at 
0xaab652c, matplotlib.axis.YTick object at 0xaab68ec, 
matplotlib.axis.YTick object at 0xaab6cec]

Hope it helps,

Malte

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib-users Digest, Vol 48, Issue 23

2010-05-17 Thread Alan G Isaac
On 5/17/2010 11:31 AM, Sandy Ydnas wrote:
 it gets stuck in all tested by me IDE inclusing Komodo,pythonxy

http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show

hth,
Alan Isaac


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] pcolor shading=interp change interpolation method?

2010-05-17 Thread Eric Firing
On 05/17/2010 06:32 AM, Reckoner wrote:
 Hi,

 Using the following

   pcolor(x,y,z,shading='interp')

 is it possible to change the interpolation method used? I noticed that
 there are set_interpolation methods for images created using

 In [83]: h = imshow( z)

 In [84]: h.set_interpolation?
 Type:   instancemethod
 Base Class: type 'instancemethod'
 String Form: bound method AxesImage.set_interpolation of
 matplotlib.image.AxesImage object at 0x047B27D0
 Namespace:  Interactive
 File:   c:\python26\lib\site-packages\matplotlib\image.py
 Definition: h.set_interpolation(self, s)
 Docstring:
  Set the interpolation method the image uses when resizing.

 ACCEPTS: ['nearest' | 'bilinear' | 'bicubic' | 'spline16' |
 'spline36' | 'hanning' | 'hamming' | 'hermite' | 'kaiser' |
 'quadric' | 'catrom' | 'gaussian' | 'bessel' | 'mitchell' |
 'sinc' | 'lanczos' | ]

 are these available for pcolor?

No.  Pcolor simply fills quadrilaterals.  There is a NonUniformImage 
class that accepts image interpolation options.  I don't think anyone 
has ever gotten around to giving it a nice interface via an Axes method 
or pyplot function, but there is an example of its use:

http://matplotlib.sourceforge.net/examples/pylab_examples/image_nonuniform.html

In the svn version of mpl there is also a gouraud shading option to 
pcolormesh, which provides interpolation on non-rectangular grids.

Eric

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] matplotlib font in cairo

2010-05-17 Thread copyrights
Hallo,

I'm try to use MathTextParser output for cairo in my wxpython gui. Works well 
under ubunutu linux (maybe dublicated font) but fails under windows 
(screenshot: http://www.ubuntu-pics.de/bild/62985/auswahl_017_RC86gk.png ).

How to tell cairo to use the font file from mpl-data?

Here some code:

from matplotlib.mathtext import MathTextParser
from matplotlib.font_manager import ttfFontProperty
import wx
import wx.lib.wxcairo
import cairo

#...
MPC = MathTextParser(Cairo)
dc = wx.BufferedPaintDC(self)
ctx = wx.lib.wxcairo.ContextFromDC(dc)
#...
width, height, descent, glyphs, rects = 
self.mathtext_parser.parse(r$a_0+a_1\xi+a_2\xi^2+a_3\xi^3$,dpi,prop)
#...

for font, fontsize, s, ox, oy in glyphs:
   #...
   fontProp = ttfFontProperty(font)
   #...
   ctx.select_font_face (fontProp.name,
 self.fontangles [fontProp.style],
 self.fontweights[fontProp.weight])

   #...
   ctx.show_text(s.encode(utf-8))
   #...
#...

greetz

Frank

--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] py2exe and matplotlib errors when executing exe

2010-05-17 Thread New2Python

Hi All,

I hope someone can help, I have run into a few problems when trying to
execute an exe file created when I use py2exe with matplotlib.
I have python2.5, matplotlib v0.99.1 and py2exe from GUI2Exe v0.5.0
optimisation is python -OO
the files compile correctly however when I execute the exe I get an error as
shown below
this is an extract

  File matplotlib\mlab.pyo, line 380, in module
TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'

the traceback points to this line of my code

from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg

does anyone know how to solve this, i have seen references made to numpy but
not matplotlib

Regards

Marco



-- 
View this message in context: 
http://old.nabble.com/py2exe-and-matplotlib-errors-when-executing-exe-tp28589875p28589875.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] py2exe and matplotlib errors when executing exe

2010-05-17 Thread Christoph Gohlke
This is probably the docstring problem mentioned at the bottom of 
http://www.py2exe.org/index.cgi/MatPlotLib.

--
Christoph

On 5/17/2010 4:07 PM, New2Python wrote:

 Hi All,

 I hope someone can help, I have run into a few problems when trying to
 execute an exe file created when I use py2exe with matplotlib.
 I have python2.5, matplotlib v0.99.1 and py2exe from GUI2Exe v0.5.0
 optimisation is python -OO
 the files compile correctly however when I execute the exe I get an error as
 shown below
 this is an extract

File matplotlib\mlab.pyo, line 380, inmodule
 TypeError: unsupported operand type(s) for %: 'NoneType' and 'dict'

 the traceback points to this line of my code

 from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg

 does anyone know how to solve this, i have seen references made to numpy but
 not matplotlib

 Regards

 Marco


--

___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users