[Matplotlib-users] colorbar() ticklabel color

2010-11-29 Thread Amit Finkler
Hi,


I am trying to produce a pcolor figure with a black background using

pylab.figure(facecolor = 'black')

Consequently, I need to change the tick colors and xlabel and ylabel
colors to white using

pylab.xlabel('whatever is on the xlabel', color = 'white', fontsize
= 14)
pylab.ylabel('whatever is on the ylabel', color = 'white', fontsize
= 14)

pylab.yticks(color = 'white')
pylab.xticks(color = 'white')


Up to this point, everything is OK. The next thing I need to do is
change the colors of the ticks and the ticklabels in the colorbar. I
understand that there are no simple pylab. commands which do so. I saw
in some matplotlib-users messages that one can write the following to
change the fontsize, for example:

for t in cb.ax.get_yticklabels():
 t.set_fontsize(14)


I tried adding another line to this loop:

 t.set_color('white')


On one hand, there is no error message during parsing or compilation. On
the other hand, nothing actually changes, i.e. the color of the
ticklabels and ticks stays black.


How does one change this property?


Amit


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] display multi languages in a string.

2010-11-29 Thread Michael Droettboom
That is correct.  Matplotlib doesn't have font substitution support -- 
it only ever uses a single font for each text object.  You will need to 
use separate text objects to do this kind of multi-lingual text, unless 
you can find a single font with all of the glyphs.


Mike

On 11/24/2010 10:19 PM, honglei junan wrote:



i get matplotlib from Sourceforge ,it's matplotlib-1.0.0.win32-py2.6.exe
OS:Win7

ActivePython-2.6.6.15-win32-x86.msi
here is the code:

# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
plt.figure(figsize=(8,4))
a = plt.text(0.05, 0.05, uDefault Font缺省字体조선어にほんごภาษา
ไทย)#multi language ,some cann't display
plt.text(0.05, 0.45, uMicrosoft YaHei微软雅黑,
fontproperties='Microsoft YaHei')#Chinese OK
plt.text(0.05, 0.25, uLilyUPCภาษาไทย,
fontproperties='LilyUPC')#Tai OK
plt.xlabel(uxlabelにほん ご,fontproperties='STXihei')#Japanese ,OK
plt.ylabel(uylabel조선 어,fontproperties='Malgun Gothic')#Korea,OK
plt.show()


C:\Python26\Lib\site-packages\matplotlib\mpl-data\matplotlibrc:



font.family : sans-serif
font.sans-serif : Microsoft YaHei,Malgun 
Gothic,LilyUPC,FangSong,YouYuan,SimHei,STKaiti,STSong,SimSun-ExtB,Webdings,Bitstream 
Vera Sans, Lucida Grande, Verdana, Geneva, Lucid, Arial, Helvetica, 
Avant Garde, sans-serif


it seems if a default font doesn't have all char's in the Default 
Font缺省字体조선어にほんごภาษาไทย string,it won't display correctly.



--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev


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


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] small bugfix in font_manager.py

2010-11-29 Thread Michael Droettboom
The fontManager is essentially a replacement for what fontconfig 
provides on many platforms -- so it's intended that the fontManager 
doesn't exist if the user opts to use fontconfig.  However, that's still 
an experimental option because it hasn't been formally tested on many 
platforms, and, as you point out, there may still be code paths that 
aren't coded correctly for that option.

Mike

On 11/25/2010 10:34 AM, Benjamin Root wrote:
 On Wednesday, November 24, 2010, Daniel Hyamsdhy...@gmail.com  wrote:
 MPL 1.0.0, OSX
 If USE_FONTCONFIG is turned on, the function 
 FontProperties.get_size_in_points will sometimes fail, because it is wanting 
 to use fontManager, which is still 'None' if USE_FONTCONFIG is on.  I'm 
 not sure if it's the proper way to fix it, but here is a small patch that 
 works (meaning that at least the code doesn't die; I can't vouch for much 
 else):


 ORIGINAL:
  def get_size_in_points(self):if self._size is not None: 
try:return float(self._size)

  except ValueError:passdefault_size = 
 fontManager.get_default_size()return default_size * 
 font_scalings.get(self._size)


 NEW:
  def get_size_in_points(self):if self._size is not None: 
try:return float(self._size)except ValueError:

  passif fontManager:default_size = 
 fontManager.get_default_size()else:   default_size = 
 rcParams['font.size']

  return default_size * font_scalings.get(self._size)

 --
 Daniel Hyams
 dhy...@gmail.com


 I personally think that this is reasonable, as it guarantees a size
 value to come from somewhere.  However, I am concerned about
 fontManager being None. If it isn't a bug for it to be None at this
 point, then I have to wonder where-else in the code needs a check for
 None?  If it is a bug, then what should it be when USE_FONTCONFIG is
 true?

 Good catch Daniel.

 Ben Root

 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] report a problem on importing pylab OR pyplot error

2010-11-29 Thread Michael Droettboom
I think you may have an .afm font file on your system that the AFM 
parser in matplotlib is having trouble with.

Can you use the debugger to figure out what the value of fpath is on 
line 578 of font_manager.py is in the traceback below?  Then we could 
figure out what the difficult file is.

Mike

On 11/25/2010 08:54 PM, Daoliang Tan wrote:
 Dear all,

 I am facing a weird problem when I import pylab or pyplot modules.
 Right now, I can successfully import matplotlib. But  after I issue
 the command ipython -pylab --verbose-helpful, I get the following
 error:
 =
 $HOME=/home/michael
 CONFIGDIR=/home/michael/.matplotlib
 matplotlib data path /usr/share/matplotlib/mpl-data
 loaded rc file /etc/matplotlibrc
 matplotlib version 0.99.3
 verbose.level helpful
 interactive is False
 units is False
 platform is linux2
 font search path ['/usr/share/matplotlib/mpl-data/fonts/ttf',
 '/usr/share/matplotlib/mpl-data/fonts/afm']
 Traceback (most recent call last):
File /usr/bin/ipython, line 28, inmodule
  IPython.Shell.start().mainloop()
File /usr/lib/pymodules/python2.6/IPython/Shell.py, line 1241, in start
  return shell(user_ns = user_ns)
File /usr/lib/pymodules/python2.6/IPython/Shell.py, line 1106, in 
 __init__
  shell_class=MatplotlibShell)
File /usr/lib/pymodules/python2.6/IPython/Shell.py, line 73, in __init__
  debug=debug,shell_class=shell_class)
File /usr/lib/pymodules/python2.6/IPython/ipmaker.py, line 100, in
 make_IPython
  embedded=embedded,**kw)
File /usr/lib/pymodules/python2.6/IPython/Shell.py, line 627, in __init__
  user_ns,user_global_ns,b2 =
 self._matplotlib_config(name,user_ns,user_global_ns)
File /usr/lib/pymodules/python2.6/IPython/Shell.py, line 556, in
 _matplotlib_config
  import matplotlib.pylab as pylab
File /usr/lib/pymodules/python2.6/matplotlib/pylab.py, line 206, 
 inmodule
  from matplotlib import mpl  # pulls in most modules
File /usr/lib/pymodules/python2.6/matplotlib/mpl.py, line 2, inmodule
  from matplotlib import axis
File /usr/lib/pymodules/python2.6/matplotlib/axis.py, line 10, inmodule
  import matplotlib.font_manager as font_manager
File /usr/lib/pymodules/python2.6/matplotlib/font_manager.py, line
 1301, inmodule
  _rebuild()
File /usr/lib/pymodules/python2.6/matplotlib/font_manager.py, line
 1292, in _rebuild
  fontManager = FontManager()
File /usr/lib/pymodules/python2.6/matplotlib/font_manager.py, line
 1010, in __init__
  self.afmlist = createFontList(self.afmfiles, fontext='afm')
File /usr/lib/pymodules/python2.6/matplotlib/font_manager.py, line
 578, in createFontList
  font = afm.AFM(fh)
File /usr/lib/pymodules/python2.6/matplotlib/afm.py, line 303, in 
 __init__
  parse_afm(fh)
File /usr/lib/pymodules/python2.6/matplotlib/afm.py, line 291, in 
 parse_afm
  dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)
File /usr/lib/pymodules/python2.6/matplotlib/afm.py, line 176, in
 _parse_char_metrics
  bbox = _to_list_of_floats(vals[3][2:])
File /usr/lib/pymodules/python2.6/matplotlib/afm.py, line 58, in
 _to_list_of_floats
  return [_to_float(val) for val in s.split()]
 ValueError: invalid literal for float(): uni2605
 ===

 Each time, as long as I import pylab OR pyplot, I will obtain
 ValueError: invalid literal for float(): uni2605. After googling a
 long time, I can not get an idea to address this issue. Can anyone
 give me some hints?

 My computer configuration is the following:

 1. OS: debian squeeze Linux  2.6.32-5-amd64 #1 SMP Sat Oct 30 14:18:21
 UTC 2010 x86_64 GNU/Linux
 2. matplotlib version:  0.99.3
 3. The matplotlib is installed from the debian repository.
 4. no any special customization of matplotlibrc
 5. import pylab will produce this error.
 6. python version: 2.6.6-3


 I have reinstalled these packages many times and this does not solve
 this issue.

 Thanks for your help!

 Daoliang

 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into 

Re: [Matplotlib-users] small bugfix in font_manager.py

2010-11-29 Thread Daniel Hyams
Just out of curiosity, is anyone using the fontconfig way of mapping fonts?
 I turned it on one day, but the immediate problem was that no mathtext
worked any more; so I turned it back off.  Any mathtext in titles, labels,
etc. just rendered as a much of seemingly random letters.

And I'll tack a second question in here as well; the reason that I was
playing with fontconfig is that the font cache takes a really long time to
build in certain circumstances (I'm having trouble identifying exactly
when)so I guess the question is...has anyone else seen this?  For
example, on my (2008 vintage) mac mini, a complete rebuild of the font cache
takes around 3 seconds, which is fine.  On a macbook pro (tested on three
different machines so far), it takes 30 seconds.  This makes no sense at all
to me, so any insights welcome :)

I initially thought that perhaps the other users had a ton more fonts than
I, but I don't think so...if I remember correctly, their font cache on the
macbook pro ended up being smaller than mine on the mini.


On Mon, Nov 29, 2010 at 10:10 AM, Michael Droettboom md...@stsci.eduwrote:

 The fontManager is essentially a replacement for what fontconfig
 provides on many platforms -- so it's intended that the fontManager
 doesn't exist if the user opts to use fontconfig.  However, that's still
 an experimental option because it hasn't been formally tested on many
 platforms, and, as you point out, there may still be code paths that
 aren't coded correctly for that option.

 Mike

 On 11/25/2010 10:34 AM, Benjamin Root wrote:
  On Wednesday, November 24, 2010, Daniel Hyamsdhy...@gmail.com  wrote:
  MPL 1.0.0, OSX
  If USE_FONTCONFIG is turned on, the function
 FontProperties.get_size_in_points will sometimes fail, because it is wanting
 to use fontManager, which is still 'None' if USE_FONTCONFIG is on.  I'm
 not sure if it's the proper way to fix it, but here is a small patch that
 works (meaning that at least the code doesn't die; I can't vouch for much
 else):
 
 
  ORIGINAL:
   def get_size_in_points(self):if self._size is not None:
try:return float(self._size)
 
   except ValueError:passdefault_size
 = fontManager.get_default_size()return default_size *
 font_scalings.get(self._size)
 
 
  NEW:
   def get_size_in_points(self):if self._size is not None:
try:return float(self._size)except
 ValueError:
 
   passif fontManager:default_size =
 fontManager.get_default_size()else:   default_size =
 rcParams['font.size']
 
   return default_size * font_scalings.get(self._size)
 
  --
  Daniel Hyams
  dhy...@gmail.com
 
 
  I personally think that this is reasonable, as it guarantees a size
  value to come from somewhere.  However, I am concerned about
  fontManager being None. If it isn't a bug for it to be None at this
  point, then I have to wonder where-else in the code needs a check for
  None?  If it is a bug, then what should it be when USE_FONTCONFIG is
  true?
 
  Good catch Daniel.
 
  Ben Root
 
 
 --
  Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
  Tap into the largest installed PC base  get more eyes on your game by
  optimizing for Intel(R) Graphics Technology. Get started today with the
  Intel(R) Software Partner Program. Five $500 cash prizes are up for
 grabs.
  http://p.sf.net/sfu/intelisp-dev2dev
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users



 --
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your game by
 optimizing for Intel(R) Graphics Technology. Get started today with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




-- 
Daniel Hyams
dhy...@gmail.com
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] small bugfix in font_manager.py

2010-11-29 Thread Michael Droettboom

On 11/29/2010 10:52 AM, Daniel Hyams wrote:
Just out of curiosity, is anyone using the fontconfig way of mapping 
fonts?  I turned it on one day, but the immediate problem was that no 
mathtext worked any more; so I turned it back off.  Any mathtext in 
titles, labels, etc. just rendered as a much of seemingly random letters.
That's one of the drawbacks of the fontconfig mode -- probably the main 
reason it isn't turned on by default.  fontconfig only looks in 
system-standard locations for fonts (by default), and matplotlib 
installs its special math fonts in a different place.  fontconfig 
provides a C-level API to add another search directory, but it would 
have to be wrapped for Python.


And I'll tack a second question in here as well; the reason that I was 
playing with fontconfig is that the font cache takes a really long 
time to build in certain circumstances (I'm having trouble identifying 
exactly when)so I guess the question is...has anyone else seen 
this?  For example, on my (2008 vintage) mac mini, a complete rebuild 
of the font cache takes around 3 seconds, which is fine.  On a macbook 
pro (tested on three different machines so far), it takes 30 seconds. 
 This makes no sense at all to me, so any insights welcome :)
It's dependent on a) how many fonts you have installed and b) the 
performance of the file system they are on.  On my Linux machine with a 
number of network shares involved, it can take a very long time.


I initially thought that perhaps the other users had a ton more fonts 
than I, but I don't think so...if I remember correctly, their font 
cache on the macbook pro ended up being smaller than mine on the mini.

It's hard to say what might be causing this.

However, why are you concerned about it, since the cache only has to be 
built once?  (After all, that is the point of an on-disk font cache in 
the first place...)


Mike



On Mon, Nov 29, 2010 at 10:10 AM, Michael Droettboom md...@stsci.edu 
mailto:md...@stsci.edu wrote:


The fontManager is essentially a replacement for what fontconfig
provides on many platforms -- so it's intended that the fontManager
doesn't exist if the user opts to use fontconfig.  However, that's
still
an experimental option because it hasn't been formally tested on
many
platforms, and, as you point out, there may still be code paths that
aren't coded correctly for that option.

Mike

On 11/25/2010 10:34 AM, Benjamin Root wrote:
 On Wednesday, November 24, 2010, Daniel Hyamsdhy...@gmail.com
mailto:dhy...@gmail.com  wrote:
 MPL 1.0.0, OSX
 If USE_FONTCONFIG is turned on, the function
FontProperties.get_size_in_points will sometimes fail, because it
is wanting to use fontManager, which is still 'None' if
USE_FONTCONFIG is on.  I'm not sure if it's the proper way to fix
it, but here is a small patch that works (meaning that at least
the code doesn't die; I can't vouch for much else):


 ORIGINAL:
  def get_size_in_points(self):if self._size is not
None:try:return float(self._size)

  except ValueError:pass  
 default_size = fontManager.get_default_size()return

default_size * font_scalings.get(self._size)


 NEW:
  def get_size_in_points(self):if self._size is not
None:try:return float(self._size)
   except ValueError:


  passif fontManager:  
 default_size = fontManager.get_default_size()else:  
default_size = rcParams['font.size']


  return default_size * font_scalings.get(self._size)

 --
 Daniel Hyams
 dhy...@gmail.com mailto:dhy...@gmail.com


 I personally think that this is reasonable, as it guarantees a size
 value to come from somewhere.  However, I am concerned about
 fontManager being None. If it isn't a bug for it to be None at this
 point, then I have to wonder where-else in the code needs a
check for
 None?  If it is a bug, then what should it be when USE_FONTCONFIG is
 true?

 Good catch Daniel.

 Ben Root



--
 Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
 Tap into the largest installed PC base  get more eyes on your
game by
 optimizing for Intel(R) Graphics Technology. Get started today
with the
 Intel(R) Software Partner Program. Five $500 cash prizes are up
for grabs.
 http://p.sf.net/sfu/intelisp-dev2dev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users




[Matplotlib-users] display each images from a directory

2010-11-29 Thread Massimo Di Stefano
Hello All,

i'm tring to write python code to display images from a directory .. but i'm 
not able to learn how to use the matplotlib events
to handle how the images will be displaied.

simpli i need to pass to the code the path to directory where i have several 
tiff files and disply them one at time using a key event.

to display a single image i'm using somethin like :



#!/usr/bin/env python
from pylab import *
try:
import Image
except ImportError, exc:
raise SystemExit(PIL must be installed to run this example)
import glob

def dispimg(input):
image = Image.open(input)
im = imshow(image, origin='lower')
show()



###

i tried to define a key action like :


def onpress(event):
if event.key=='a':
fig.canvas.draw()


# and set my directory with :

fig = figure()
fig.canvas.mpl_connect('key_press_event', onpress)
TIFFS = glob.glob(/home/habcam/habcamdata/20100820_1840/*.tif)
print num TIFFS %d % len(TIFFS)

##

but i'm not able to learn how to plot them and update the displayed image using 
the key bindings :

for tif in TIFFS:
print tif
show()


thanks a lot for Any help!


Massimo.
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] display each images from a directory

2010-11-29 Thread Benjamin Root
On Mon, Nov 29, 2010 at 1:48 PM, Massimo Di Stefano 
massimodisa...@gmail.com wrote:

 Hello All,

 i'm tring to write python code to display images from a directory .. but
 i'm not able to learn how to use the matplotlib events
 to handle how the images will be displaied.

 simpli i need to pass to the code the path to directory where i have
 several tiff files and disply them one at time using a key event.

 to display a single image i'm using somethin like :



 #!/usr/bin/env python
 from pylab import *
 try:
import Image
 except ImportError, exc:
raise SystemExit(PIL must be installed to run this example)
 import glob

 def dispimg(input):
image = Image.open(input)
im = imshow(image, origin='lower')
show()



 ###

 i tried to define a key action like :


 def onpress(event):
if event.key=='a':
fig.canvas.draw()


 # and set my directory with :

 fig = figure()
 fig.canvas.mpl_connect('key_press_event', onpress)
 TIFFS = glob.glob(/home/habcam/habcamdata/20100820_1840/*.tif)
 print num TIFFS %d % len(TIFFS)

 ##

 but i'm not able to learn how to plot them and update the displayed image
 using the key bindings :

 for tif in TIFFS:
print tif
show()


 thanks a lot for Any help!


 Massimo.


Massimo,

You might want to try a different approach.  Instead of having a keypress
binding, why not just have a normal for-loop with a call to dispimg() and
some sort of blocking input like a wait for keypress or something?  You
might even be able to do something with a while loop that checks for a 'q'
input (for quit) and then have two keys be used for forward and backwards
progression through your list of TIFFS.

Another thing to consider is just not use matplotlib at all, and just use
linux's image viewer (called eog) which you can give it the first file in
a directory, and you can use the arrow keys to move through the list of all
image files in that directory.

I hope that helps,

Ben Root
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] adding a number of minor tick marks between major tick marks feature

2010-11-29 Thread Matthew W. Priddy
Matplotlib developers,

I really like using matplotlib to create quality plots, and it seems to have an 
option for just about everything.  However, one thing that is not easy to 
change is the location of minor tick marks.  To set major tick mark locations, 
one can simply use the xticks command.  And now we can atleast turn on the 
minor tick marks with the minorticks_on() command.  

But, is there any way to implement something similar to xticks for minor tick 
marks?  Even better would be a feature that allowed the user to simply specify 
the number of minor tick marks that are evenly spaced between the major tick 
marks?

Thanks.

--Matthew


--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] inset_axes and polar plots

2010-11-29 Thread Pascal Horton
Hi everybody,

I'm trying to insert polar axes into another axis. I need to place many
windrose-like plots (bar plots in a polar axis) inside an xy plot. I need
them to move while panning the xy plot. To do so, I tried with inset_axes,
but I cannot force the new axis to be polar.

Or is there a better way to to it ?

Here is the code:



#!/usr/bin/python

import matplotlib.pyplot as plt
import numpy as np
import mpl_toolkits.axes_grid1.inset_locator as iloc

angleStart = 0.75
angleEnd = 2.5
ringOutterLimit = 0.95
ringWidth = 0.4
lineWidth = 1
values = np.array([0., 0.3, 0.95, 0.5, 0.1])


# Figure and main axis
fig = plt.figure(figsize=(5,5))
ax1 = fig.add_subplot(111)
ax1.plot([0,1], [0,1])
ax1.set_aspect(1.)

# Second axis
ax2 = iloc.inset_axes(ax1, width=100%, height=100%, loc=3,
 bbox_to_anchor=(0.3, 0.5, 0.1, 0.1),
 bbox_transform=ax1.transData)

bars = ax2.bar([np.pi/2., np.pi], [0.5, 0.2], width=.1*np.pi)

# Third axis
ax3 = iloc.inset_axes(ax1, width=100%, height=100%, loc=3,
 bbox_to_anchor=(0.5, 0.7, 0.1, 0.1),
 bbox_transform=ax1.transData)

bars = ax3.bar([np.pi/2., np.pi/4.], [0.1, 0.4], width=.1*np.pi)

plt.show()



Thanks a lot,

Pascal
--
Increase Visibility of Your 3D Game App  Earn a Chance To Win $500!
Tap into the largest installed PC base  get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users