Re: [Matplotlib-users] Animating selected plot elements

2011-04-05 Thread Alejandro Weinstein
On Mon, Apr 4, 2011 at 4:46 PM, Alejandro Weinstein
alejandro.weinst...@gmail.com wrote:
 Any advice on how to fix the problem? Or may be this way is obsolete,
 but all the animation examples I've found so far don't consider a
 fixed background.

Adding

import matplotlib
matplotlib.use('GTKAgg')

solved the problem.

But now I get this warning:

/usr/lib/pymodules/python2.6/matplotlib/backends/backend_gtk.py:621:
DeprecationWarning: Use the new widget gtk.Tooltip
  self.tooltips = gtk.Tooltips()

I am running Ubuntu 10.04, with MPL version 0.99.1.2-3ubuntu1, in case
that matter.

Alejandro.

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Animating selected plot elements

2011-04-05 Thread Alejandro Weinstein
On Mon, Apr 4, 2011 at 6:14 PM, Drew Frank ajfr...@ics.uci.edu wrote:
 This will not address your immediate problem with update_line not
 being called, but if you want to animate something over a non-blank
 background you will soon run into another issue.  I posted here about
 that issue a while back:
 http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg19104.html

 To aid future web searchers, here is my final reply to that thread,
 which I accidentally sent to Benjamin Root rather than to the list:
 The way the cookbook example is written (calling copy_from_background
 early), it will always copy a blank, white region -- even if
 non-animated elements have been plotted prior to the call.  This
 caused problems for me because I wanted to animate some patches on the
 top of a non-blank background, but calling restore_from_region just
 overwrote my background with white.

 Drew Frank

I also needed to use Frank's approach (described in the link above) to
make my animation works. Is it possible to fix the code in the
cookbook? I tried to edit the page but I am not allowed.

Alejandro.

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] legend font weight with TeX

2011-04-05 Thread Eli Brosh
Hello,

I am using pylab with the rc parameter
rcParams['text.usetex']=True

Now, I would like to make a legend with bold fonts.
So, I tried two options:

1)
from matplotlib.font_manager import fontManager, FontProperties
font= FontProperties(weight='bold',size=26)
plot([1,2,3],[1,2,3],'k',label='label1')
legend(loc='lower left', prop=font)


2) After the legend(loc='lower left', prop=font) statement, I put:
legend1=gca().get_legend()
ltext = legend1.get_texts() # all the text.Text instance in the legend
setp(ltext, fontweight='bold') # the legend text fontsize



Neither of these options changed the legend font weight to bold.
How can this be done?
How to change the legend font weight when rcParams['text.usetex']=True ?

Thanks,
Eli
--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] legend font weight with TeX

2011-04-05 Thread Darren Dale
On Tue, Apr 5, 2011 at 2:51 PM, Eli Brosh ebro...@gmail.com wrote:
 Hello,

 I am using pylab with the rc parameter
 rcParams['text.usetex']=True

 Now, I would like to make a legend with bold fonts.
 So, I tried two options:

 1)
 from matplotlib.font_manager import fontManager, FontProperties
 font= FontProperties(weight='bold',size=26)
 plot([1,2,3],[1,2,3],'k',label='label1')
 legend(loc='lower left', prop=font)


 2) After the legend(loc='lower left', prop=font) statement, I put:
 legend1=gca().get_legend()
 ltext = legend1.get_texts() # all the text.Text instance in the legend
 setp(ltext, fontweight='bold') # the legend text fontsize



 Neither of these options changed the legend font weight to bold.
 How can this be done?
 How to change the legend font weight when rcParams['text.usetex']=True ?

I think you may have to do something like label=r'\textbf{label1}'.

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] legend font weight with TeX

2011-04-05 Thread Eli Brosh
Thanks,
label=r'$\bf{label1}$'
worked.

Regards,
Eli


On Tue, Apr 5, 2011 at 10:14 PM, Darren Dale dsdal...@gmail.com wrote:

 On Tue, Apr 5, 2011 at 2:51 PM, Eli Brosh ebro...@gmail.com wrote:
  Hello,
 
  I am using pylab with the rc parameter
  rcParams['text.usetex']=True
 
  Now, I would like to make a legend with bold fonts.
  So, I tried two options:
 
  1)
  from matplotlib.font_manager import fontManager, FontProperties
  font= FontProperties(weight='bold',size=26)
  plot([1,2,3],[1,2,3],'k',label='label1')
  legend(loc='lower left', prop=font)
 
 
  2) After the legend(loc='lower left', prop=font) statement, I put:
  legend1=gca().get_legend()
  ltext = legend1.get_texts() # all the text.Text instance in the legend
  setp(ltext, fontweight='bold') # the legend text fontsize
 
 
 
  Neither of these options changed the legend font weight to bold.
  How can this be done?
  How to change the legend font weight when rcParams['text.usetex']=True ?

 I think you may have to do something like label=r'\textbf{label1}'.

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] LaTeX matplotlib Bug?

2011-04-05 Thread Sean Lake
Hello all,

I'm trying to specify a range of numbers in a particular legend using LaTeX. In 
order to do so I'm feeding it the string: r$80--120. The output should be 
have an endash, 80–120, but I'm getting 80--120. This is a standard feature 
of LaTeX ( http://en.wikibooks.org/wiki/LaTeX/Formatting ), so I don't know 
what's going on. 

Thanks,
Sean Lake

uname -a
Darwin dynamic_051.astro.ucla.edu 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 
29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386

(You also have a bug on this web page: 
http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#reporting-problems
 , The line python -c `import matplotlib; print matplotlib.__version__` should 
not have back-ticks)
/sw/bin/python2.6 -c 'import matplotlib; print matplotlib.__version__'
1.0.0

Got matplotlib via fink:
fink --version
Package manager version: 0.29.21
Distribution version: selfupdate-rsync Sun Apr  3 02:28:24 2011, 10.6, x86_64
Trees: local/main stable/main stable/crypto unstable/main unstable/crypto

matplotlibrc file:
text.usetex : True

#backend : MacOSX
backend : GTKAgg
#backend : ps
#backend : pdf



--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] LaTeX matplotlib Bug?

2011-04-05 Thread Andre' Walker-Loud
Hi Sean,

I just checked - the hyphenation you want does not work in LaTeX in math mode.  
Try removing the $-signs in your string command.  Then the hyphenation should 
work.


Andre




On Apr 5, 2011, at 4:56 PM, Sean Lake wrote:

 Hello all,
 
 I'm trying to specify a range of numbers in a particular legend using LaTeX. 
 In order to do so I'm feeding it the string: r$80--120. The output should 
 be have an endash, 80–120, but I'm getting 80--120. This is a standard 
 feature of LaTeX ( http://en.wikibooks.org/wiki/LaTeX/Formatting ), so I 
 don't know what's going on. 
 
 Thanks,
 Sean Lake
 
 uname -a
 Darwin dynamic_051.astro.ucla.edu 10.7.0 Darwin Kernel Version 10.7.0: Sat 
 Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
 
 (You also have a bug on this web page: 
 http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#reporting-problems
  , The line python -c `import matplotlib; print matplotlib.__version__` 
 should not have back-ticks)
 /sw/bin/python2.6 -c 'import matplotlib; print matplotlib.__version__'
 1.0.0
 
 Got matplotlib via fink:
 fink --version
 Package manager version: 0.29.21
 Distribution version: selfupdate-rsync Sun Apr  3 02:28:24 2011, 10.6, x86_64
 Trees: local/main stable/main stable/crypto unstable/main unstable/crypto
 
 matplotlibrc file:
 text.usetex : True
 
 #backend : MacOSX
 backend : GTKAgg
 #backend : ps
 #backend : pdf
 
 
 
 --
 Xperia(TM) PLAY
 It's a major breakthrough. An authentic gaming
 smartphone on the nation's most reliable network.
 And it wants your games.
 http://p.sf.net/sfu/verizon-sfdev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] LaTeX matplotlib Bug?

2011-04-05 Thread gary ruben
Um, how about r$80--120$ instead of r$80--120 ?

On Wed, Apr 6, 2011 at 9:56 AM, Sean Lake odysseus9...@gmail.com wrote:
 Hello all,

 I'm trying to specify a range of numbers in a particular legend using LaTeX. 
 In order to do so I'm feeding it the string: r$80--120. The output should 
 be have an endash, 80–120, but I'm getting 80--120. This is a standard 
 feature of LaTeX ( http://en.wikibooks.org/wiki/LaTeX/Formatting ), so I 
 don't know what's going on.

 Thanks,
 Sean Lake

 uname -a
 Darwin dynamic_051.astro.ucla.edu 10.7.0 Darwin Kernel Version 10.7.0: Sat 
 Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386

 (You also have a bug on this web page: 
 http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#reporting-problems
  , The line python -c `import matplotlib; print matplotlib.__version__` 
 should not have back-ticks)
 /sw/bin/python2.6 -c 'import matplotlib; print matplotlib.__version__'
 1.0.0

 Got matplotlib via fink:
 fink --version
 Package manager version: 0.29.21
 Distribution version: selfupdate-rsync Sun Apr  3 02:28:24 2011, 10.6, x86_64
 Trees: local/main stable/main stable/crypto unstable/main unstable/crypto

 matplotlibrc file:
 text.usetex : True

 #backend : MacOSX
 backend : GTKAgg
 #backend : ps
 #backend : pdf



 --
 Xperia(TM) PLAY
 It's a major breakthrough. An authentic gaming
 smartphone on the nation's most reliable network.
 And it wants your games.
 http://p.sf.net/sfu/verizon-sfdev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] LaTeX matplotlib Bug?

2011-04-05 Thread Sean Lake
Ah, sorry about that. In the script I was using it had the closing $. In spite 
of the typo, Gary Ruben found the actual bug: math mode doesn't support --. 

Thanks,
Sean

On Apr 5, 2011, at 17:08, gary ruben wrote:

 Um, how about r$80--120$ instead of r$80--120 ?
 
 On Wed, Apr 6, 2011 at 9:56 AM, Sean Lake odysseus9...@gmail.com wrote:
 Hello all,
 
 I'm trying to specify a range of numbers in a particular legend using LaTeX. 
 In order to do so I'm feeding it the string: r$80--120. The output should 
 be have an endash, 80–120, but I'm getting 80--120. This is a standard 
 feature of LaTeX ( http://en.wikibooks.org/wiki/LaTeX/Formatting ), so I 
 don't know what's going on.
 
 Thanks,
 Sean Lake
 
 uname -a
 Darwin dynamic_051.astro.ucla.edu 10.7.0 Darwin Kernel Version 10.7.0: Sat 
 Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
 
 (You also have a bug on this web page: 
 http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#reporting-problems
  , The line python -c `import matplotlib; print matplotlib.__version__` 
 should not have back-ticks)
 /sw/bin/python2.6 -c 'import matplotlib; print matplotlib.__version__'
 1.0.0
 
 Got matplotlib via fink:
 fink --version
 Package manager version: 0.29.21
 Distribution version: selfupdate-rsync Sun Apr  3 02:28:24 2011, 10.6, x86_64
 Trees: local/main stable/main stable/crypto unstable/main unstable/crypto
 
 matplotlibrc file:
 text.usetex : True
 
 #backend : MacOSX
 backend : GTKAgg
 #backend : ps
 #backend : pdf
 
 
 
 --
 Xperia(TM) PLAY
 It's a major breakthrough. An authentic gaming
 smartphone on the nation's most reliable network.
 And it wants your games.
 http://p.sf.net/sfu/verizon-sfdev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] LaTeX matplotlib Bug?

2011-04-05 Thread Andre' Walker-Loud
you appear to have another typo.

 Gary Ruben found the actual bug: math mode doesn't support --. 

Gary Ruben -- Andre Walker-Loud

:)



On Apr 5, 2011, at 5:15 PM, Sean Lake wrote:

 Ah, sorry about that. In the script I was using it had the closing $. In 
 spite of the typo, Gary Ruben found the actual bug: math mode doesn't support 
 --. 
 
 Thanks,
 Sean
 
 On Apr 5, 2011, at 17:08, gary ruben wrote:
 
 Um, how about r$80--120$ instead of r$80--120 ?
 
 On Wed, Apr 6, 2011 at 9:56 AM, Sean Lake odysseus9...@gmail.com wrote:
 Hello all,
 
 I'm trying to specify a range of numbers in a particular legend using 
 LaTeX. In order to do so I'm feeding it the string: r$80--120. The output 
 should be have an endash, 80–120, but I'm getting 80--120. This is a 
 standard feature of LaTeX ( http://en.wikibooks.org/wiki/LaTeX/Formatting 
 ), so I don't know what's going on.
 
 Thanks,
 Sean Lake
 
 uname -a
 Darwin dynamic_051.astro.ucla.edu 10.7.0 Darwin Kernel Version 10.7.0: Sat 
 Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
 
 (You also have a bug on this web page: 
 http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#reporting-problems
  , The line python -c `import matplotlib; print matplotlib.__version__` 
 should not have back-ticks)
 /sw/bin/python2.6 -c 'import matplotlib; print matplotlib.__version__'
 1.0.0
 
 Got matplotlib via fink:
 fink --version
 Package manager version: 0.29.21
 Distribution version: selfupdate-rsync Sun Apr  3 02:28:24 2011, 10.6, 
 x86_64
 Trees: local/main stable/main stable/crypto unstable/main unstable/crypto
 
 matplotlibrc file:
 text.usetex : True
 
 #backend : MacOSX
 backend : GTKAgg
 #backend : ps
 #backend : pdf
 
 
 
 --
 Xperia(TM) PLAY
 It's a major breakthrough. An authentic gaming
 smartphone on the nation's most reliable network.
 And it wants your games.
 http://p.sf.net/sfu/verizon-sfdev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 
 
 --
 Xperia(TM) PLAY
 It's a major breakthrough. An authentic gaming
 smartphone on the nation's most reliable network.
 And it wants your games.
 http://p.sf.net/sfu/verizon-sfdev
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] LaTeX matplotlib Bug?

2011-04-05 Thread Jae-Joon Lee
On Wed, Apr 6, 2011 at 9:15 AM, Sean Lake odysseus9...@gmail.com wrote:
 Gary Ruben found the actual bug: math mode doesn't support --.

Just to clarify, in latex math mode, $-$ is - (minus sign) and
$--$ is --.
And this is not a bug.

-JJ

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] LaTeX matplotlib Bug?

2011-04-05 Thread Andre' Walker-Loud
On Apr 5, 2011, at 5:51 PM, Jae-Joon Lee wrote:

 On Wed, Apr 6, 2011 at 9:15 AM, Sean Lake odysseus9...@gmail.com wrote:
 Gary Ruben found the actual bug: math mode doesn't support --.
 
 Just to clarify, in latex math mode, $-$ is - (minus sign) and
 $--$ is --.
 And this is not a bug.
 
 -JJ

Yes.  That is correct.


Andre

--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Draw only left and top part of frame

2011-04-05 Thread Markus Baden
Hi,

I draw four subplots that touch each other. Thus the middle cross of the
frame is drawn twice and appears to be thicker then the outer rectangle. I
came across an old post for an custom Axes that would allow to only draw
part of the frame

http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg10242.html

However, when I run the example provided I get an can't set attribute
error (see traceback below). I use Python 2.7.1 |EPD 7.0-1 (32-bit) on Mac
OS 10.5.8, which includes matplotlib version 1.0.1.

Is there a fix to get the custom class running again, or is there an
alternative way to achieve what I intend?

Thanks a lot,

Markus

Traceback (most recent call last):
  File frametest.py, line 165, in module
ax = plt.subplot(sub, projection='frameaxes')
  File
/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/matplotlib/pyplot.py,
line 658, in subplot
a = fig.add_subplot(*args, **kwargs)
  File
/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/matplotlib/figure.py,
line 687, in add_subplot
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
  File
/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/matplotlib/axes.py,
line 8380, in __init__
self._axes_class.__init__(self, fig, self.figbox, **kwargs)
  File
/Library/Frameworks/Python.framework/Versions/7.0/lib/python2.7/site-packages/matplotlib/axes.py,
line 459, in __init__
self.cla()
  File frametest.py, line 138, in cla
self.frame = self._frame
AttributeError: can't set attribute
--
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users