Re: [Matplotlib-users] Horizontal and vertical lines between subplots

2010-04-30 Thread Matthias Michler
On Wednesday 28 April 2010 15:07:21 Maxime Bois wrote:
> Hi all,
>
> I have created a figure with 4 subplots (2x2) and I want to separate
> them with a vertical and horizontal lines (see the green lines on my
> figure edited by Gimp) but I don't know if it's possible (I haven't find
> any example of that).
>
> I am using Python 2.5.4 and matplotlib version 0.99.0
>
> Thanks,
> Maxime

Hi Maxime,

I hope my example works for you. Please note: I used plt.axes instead of 
plt.subplot, although both generate an Axes instance, the latter doesn't 
support overlapping axes.

Kind regards,
Matthias


2by2_subplot_separated_by_lines.py
Description: application/python
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Transparent figures no longer working

2010-04-30 Thread T J
On Wed, Apr 28, 2010 at 12:22 PM, Eric Firing  wrote:
>
> It's a bug, made more confusing by the trickery that is done when printing a
> figure.  DPI, facecolor, and edgecolor that are set for a figure object are
> used only for screen display, and are overridden when the figure is saved.
>  The overriding values can be supplied to the savefig call or via rcParams.
>
> I think I have fixed the bug in svn, so that "transparent" will work as
> advertised.  In addition, I made a change so that even with
> transparent=True, if you supply facecolor and/or edgecolor to the savefig
> call, those values should be used for the figure patch when the figure is
> saved.  This might be useful if you want to keep the line around the figure,
> for example.
>

This still does not work for me.  I dug around a bit and found an
issue.  Figure.savefig() sets the 'edgecolor' and 'facecolor' of the
axis patches but delegates the patches of the figure to the actual
print command.  It does this by setting the edgecolor and facecolor
values in the kwargs dict.  However, self.canvas.print_figure()
expects edgecolor and facecolor as args, not kwargs.  So
print_figure() uses the default value: 'w' instead of 'none'.  This is
a bit inconsistent, it seems, especially b/c the PS backend  (which is
called after print_figure()) expects facecolor and edgecolor as
kwargs.

I went ahead and changed this, hoping it'd fix the issue, but it does
not.  At least now, I can see that the edgecolor and facecolor are
both set to 'none' all the way until self.figure.draw(renderer) is
called.  So somehow, the draw() command is unaffected by this still.

What next?

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


Re: [Matplotlib-users] Transparent figures no longer working

2010-04-30 Thread Eric Firing

T J wrote:

On Wed, Apr 28, 2010 at 12:22 PM, Eric Firing  wrote:

It's a bug, made more confusing by the trickery that is done when printing a
figure.  DPI, facecolor, and edgecolor that are set for a figure object are
used only for screen display, and are overridden when the figure is saved.
 The overriding values can be supplied to the savefig call or via rcParams.

I think I have fixed the bug in svn, so that "transparent" will work as
advertised.  In addition, I made a change so that even with
transparent=True, if you supply facecolor and/or edgecolor to the savefig
call, those values should be used for the figure patch when the figure is
saved.  This might be useful if you want to keep the line around the figure,
for example.



This still does not work for me.  I dug around a bit and found an
issue.  Figure.savefig() sets the 'edgecolor' and 'facecolor' of the
axis patches but delegates the patches of the figure to the actual
print command.  It does this by setting the edgecolor and facecolor
values in the kwargs dict.  However, self.canvas.print_figure()
expects edgecolor and facecolor as args, not kwargs.  So
print_figure() uses the default value: 'w' instead of 'none'.  This is
a bit inconsistent, it seems, especially b/c the PS backend  (which is
called after print_figure()) expects facecolor and edgecolor as
kwargs.


I don't see this in the version as I changed it in svn r8282.  Are you 
sure you installed and built from svn after I made the change?  Using 
the attached script,  I get the two attached (gzipped) eps files. The 
first with transparent=True, has no fill operations other than for 
generation of the glyphs; the second differs from the first in having 
two extra fill operations, one for the axes patch, the other for the 
figure patch.


When I use your transeps.tex, run latex, and then dvips, the resulting 
ps file (also gzipped and attached) has the figure with a red 
background, sitting on a white page.  I presume this is what you expect, 
and so the figure and axes really are transparent.


Eric



I went ahead and changed this, hoping it'd fix the issue, but it does
not.  At least now, I can see that the edgecolor and facecolor are
both set to 'none' all the way until self.figure.draw(renderer) is
called.  So somehow, the draw() command is unaffected by this still.

What next?

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


import matplotlib.pyplot as plt

f = plt.figure()
ax = f.add_subplot(111)
ax.plot([0,10])
f.savefig('transeps.eps', transparent=True)
f.savefig('transeps_opaque.eps')



transeps.eps.gz
Description: GNU Zip compressed data


transeps_opaque.eps.gz
Description: GNU Zip compressed data


transeps.ps.gz
Description: GNU Zip compressed data
--
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Horizontal and vertical lines between subplots

2010-04-30 Thread Maxime Bois

Hi Matthias,

This is exactly what I wanted to do (excepted for the colors of the 
lines which are quite horrible :-) )


Thanks a lot

Cheers,
Maxime


On 04/30/2010 09:56 AM, Matthias Michler wrote:

On Wednesday 28 April 2010 15:07:21 Maxime Bois wrote:
   

Hi all,

I have created a figure with 4 subplots (2x2) and I want to separate
them with a vertical and horizontal lines (see the green lines on my
figure edited by Gimp) but I don't know if it's possible (I haven't find
any example of that).

I am using Python 2.5.4 and matplotlib version 0.99.0

Thanks,
Maxime
 

Hi Maxime,

I hope my example works for you. Please note: I used plt.axes instead of
plt.subplot, although both generate an Axes instance, the latter doesn't
support overlapping axes.

Kind regards,
Matthias
   



--
   



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


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


[Matplotlib-users] Strange behaviour for zooming.

2010-04-30 Thread sathish kumar
Hi ,

I have to build custom tool bar with a single button which zooms-in /zooms-
out. I did by setting new limit with and I redraw the figure.  I used to
work in Axes coordinate system instead of data coordinate system. when I
have to zoom  I convert axes points to data coordinate system and set new
limit and I redraw the figure. When I used to execute in terminal it works
fine. But when I embedd the same thing in qt using PyQt, strange behaviour
comes. Please rectify my problem.

With Thanks
Sathish


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


Re: [Matplotlib-users] MPL uses character not defined by cmr10?

2010-04-30 Thread Michael Droettboom
I wasn't aware of these fonts -- we may want to consider distributing 
them with matplotlib instead (assuming the licensing makes sense) as it 
would greatly simplify the mathtext code.  Of course, that's a project I 
may not have time for right now.

I'll look into the case-sensitivity issue -- I'm not sure why that is 
the case.

Mike

Tony S Yu wrote:
>
> On Apr 29, 2010, at 10:43 PM, Tony S Yu wrote:
>
>>
>> On Apr 29, 2010, at 6:09 PM, Michael Droettboom wrote:
>>
>>> Those Computer Modern fonts (specifically the Bakoma distribution of 
>>> them that matplotlib includes) use a custom character set mapping 
>>> where many of the characters are in completely arbitrary locations.  
>>> For regular text, matplotlib expects a regular Unicode font 
>>> (particularly to get the minus sign).  Since cmr10 doesn't have a 
>>> standard encoding, it just won't work. 
>>
>> Hey Mike,
>>
>> Thanks for your reply. That makes sense.
>>
>> An alternative work around (I presume) would be to install 
>> the computer modern unicode fonts 
>>  (I made sure to 
>> install the ttf version). However, I'm having trouble getting MPL to 
>> find the fonts.
>>
>> The installed font is listed when calling 
>> `mpl.font_manager.OSXInstalledFonts()`, but it's not found when 
>> calling `mpl.font_manager.findfont` (with various names that would 
>> make sense: cmunrm, CMU Serif, etc.)
>>
>> Any ideas on what I'm doing wrong?
>
> Sorry, I meant to reply to the list.
>
> After clearing the fontlist cache, I was able to get this fix working.
>
> Just to summarize:
>
> * download unicode version of computer modern fonts 
> (http://sourceforge.net/projects/cm-unicode/files/)---make sure to get 
> the ttf version
>
> * clear out the fontlist cache (rm ~/.matplotlib/fontList.cache)
>
> * add the following to ~/matplotlib/matplotlibrc:
>
> font.family: serif
> font.serif: CMU Serif
>
> * alternatively, you could leave the default as sans serif and use the 
> computer modern sans serif (unicode version):
>
> font.sans-serif: CMU Sans Serif
>
> These changes produce plots where the size of normal text matches that 
> of mathtext.
>
> Thanks for you help, Mike!
>
> -Tony
>

-- 
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


Re: [Matplotlib-users] Horizontal and vertical lines between subplots

2010-04-30 Thread Jae-Joon Lee
You may do this without creating an extra axes (ax0).
Try something like

ax4.plot([0.5, 0.5], [0, 1], color='lightgreen', lw=5,
 transform=gcf().transFigure, clip_on=False)

Regards,

-JJ


On Fri, Apr 30, 2010 at 3:56 AM, Matthias Michler
 wrote:
> On Wednesday 28 April 2010 15:07:21 Maxime Bois wrote:
>> Hi all,
>>
>> I have created a figure with 4 subplots (2x2) and I want to separate
>> them with a vertical and horizontal lines (see the green lines on my
>> figure edited by Gimp) but I don't know if it's possible (I haven't find
>> any example of that).
>>
>> I am using Python 2.5.4 and matplotlib version 0.99.0
>>
>> Thanks,
>> Maxime
>
> Hi Maxime,
>
> I hope my example works for you. Please note: I used plt.axes instead of
> plt.subplot, although both generate an Axes instance, the latter doesn't
> support overlapping axes.
>
> Kind regards,
> Matthias
>
> --
>
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

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


Re: [Matplotlib-users] Labels end up outside figure

2010-04-30 Thread Jae-Joon Lee
On Thu, Apr 29, 2010 at 12:40 PM, acoffeemug
 wrote:
> Does anyone know a good fix for this? Preferably one which doesn't involve
> manual resizing?

http://matplotlib.sourceforge.net/faq/howto_faq.html#automatically-make-room-for-tick-labels

While example in the link try to make a room for ticklable, a same can
be done with a label.

If you don't mind your figure size slightly changed, you may try

savefig("yourfilename", bbox_inches="tight")

Regards,

-JJ

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


Re: [Matplotlib-users] Horizontal and vertical lines between subplots

2010-04-30 Thread Maxime Bois
Hi Jae-Joon

This method is also great and it's working with plt.subplot:

from pylab import *
subplot(221)
subplot(222)
subplot(223)
subplot(224)
plot([0.5, 0.5], [0, 1], color='lightgreen', 
lw=5,transform=gcf().transFigure, clip_on=False)
plot([0, 1], [0.5, 0.5], color='lightgreen', 
lw=5,transform=gcf().transFigure, clip_on=False)

Thank you very much

Regards,
Maxime


On 04/30/2010 04:02 PM, Jae-Joon Lee wrote:
> You may do this without creating an extra axes (ax0).
> Try something like
>
> ax4.plot([0.5, 0.5], [0, 1], color='lightgreen', lw=5,
>   transform=gcf().transFigure, clip_on=False)
>
> Regards,
>
> -JJ
>
>
> On Fri, Apr 30, 2010 at 3:56 AM, Matthias Michler
>   wrote:
>
>> On Wednesday 28 April 2010 15:07:21 Maxime Bois wrote:
>>  
>>> Hi all,
>>>
>>> I have created a figure with 4 subplots (2x2) and I want to separate
>>> them with a vertical and horizontal lines (see the green lines on my
>>> figure edited by Gimp) but I don't know if it's possible (I haven't find
>>> any example of that).
>>>
>>> I am using Python 2.5.4 and matplotlib version 0.99.0
>>>
>>> Thanks,
>>> Maxime
>>>
>> Hi Maxime,
>>
>> I hope my example works for you. Please note: I used plt.axes instead of
>> plt.subplot, although both generate an Axes instance, the latter doesn't
>> support overlapping axes.
>>
>> Kind regards,
>> Matthias
>>
>> --
>>
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>  
> --
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>


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


[Matplotlib-users] how to display value for each date in line chart or pie chart? (show y axis's value)

2010-04-30 Thread pclovec

i want to display the value for each date , now i have 3 date value , but in
chart it cannot show the value, 
in chart can show 12,45,67 

Thanks

source 
figure(2)
x=[4,5,6]
y=[12,45,67]
line,= plt.plot(x,y,label="aaa",color="red",linewidth=1,linestyle='|dashed',
marker='o',c='b')
xticks(arange(13), calendar.month_name[0:13], rotation=11)
plt.ylabel("WDR",fontsize=12, color='r')
plt.title("Price",fontsize=16, color='r')
plt.xlim(1,12)
plt.ylim(1,100,1)
plt.grid(True) 
plt.legend()
-- 
View this message in context: 
http://old.nabble.com/how-to-display-value-for-each-date-in-line-chart-or-pie-chart--%28show-y-axis%27s-value%29-tp28406803p28406803.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] Strange behaviour for zooming.

2010-04-30 Thread sathish kumar
Hi ,

I have to build custom tool bar with a single button which zooms-in /zooms-
out. I did by setting new limit with and I redraw the figure.  I used to
work in Axes coordinate system instead of data coordinate system. when I
have to zoom  I convert axes points to data coordinate system and set new
limit and I redraw the figure. When I used to execute in terminal it works
fine. But when I embedd the same thing in qt using PyQt, strange behaviour
comes. Please rectify my problem.

With Thanks
Sathish


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


Re: [Matplotlib-users] MPL uses character not defined by cmr10?

2010-04-30 Thread Michael Droettboom
Michael Droettboom wrote:
> I wasn't aware of these fonts -- we may want to consider distributing 
> them with matplotlib instead (assuming the licensing makes sense) as it 
> would greatly simplify the mathtext code.  Of course, that's a project I 
> may not have time for right now.
>   
On further looking into these fonts, it seems they're not appropriate at 
the moment.  They are missing a number of math-related symbols (such as 
infinity, for example).  They are worth keeping an eye on, because they 
have a much better and more open framework for being built vs. the 
Bakoma fonts which are essentially "closed-source" though free for 
redistribution.  (i.e. it makes it a lot harder to fix problems in 
them).  Given the time, I may look into what it would take to start 
adding these new symbols.
> I'll look into the case-sensitivity issue -- I'm not sure why that is 
> the case.
>   
This has now been fixed in SVN.

Mike
> Mike
>
> Tony S Yu wrote:
>   
>> On Apr 29, 2010, at 10:43 PM, Tony S Yu wrote:
>>
>> 
>>> On Apr 29, 2010, at 6:09 PM, Michael Droettboom wrote:
>>>
>>>   
 Those Computer Modern fonts (specifically the Bakoma distribution of 
 them that matplotlib includes) use a custom character set mapping 
 where many of the characters are in completely arbitrary locations.  
 For regular text, matplotlib expects a regular Unicode font 
 (particularly to get the minus sign).  Since cmr10 doesn't have a 
 standard encoding, it just won't work. 
 
>>> Hey Mike,
>>>
>>> Thanks for your reply. That makes sense.
>>>
>>> An alternative work around (I presume) would be to install 
>>> the computer modern unicode fonts 
>>>  (I made sure to 
>>> install the ttf version). However, I'm having trouble getting MPL to 
>>> find the fonts.
>>>
>>> The installed font is listed when calling 
>>> `mpl.font_manager.OSXInstalledFonts()`, but it's not found when 
>>> calling `mpl.font_manager.findfont` (with various names that would 
>>> make sense: cmunrm, CMU Serif, etc.)
>>>
>>> Any ideas on what I'm doing wrong?
>>>   
>> Sorry, I meant to reply to the list.
>>
>> After clearing the fontlist cache, I was able to get this fix working.
>>
>> Just to summarize:
>>
>> * download unicode version of computer modern fonts 
>> (http://sourceforge.net/projects/cm-unicode/files/)---make sure to get 
>> the ttf version
>>
>> * clear out the fontlist cache (rm ~/.matplotlib/fontList.cache)
>>
>> * add the following to ~/matplotlib/matplotlibrc:
>>
>> font.family: serif
>> font.serif: CMU Serif
>>
>> * alternatively, you could leave the default as sans serif and use the 
>> computer modern sans serif (unicode version):
>>
>> font.sans-serif: CMU Sans Serif
>>
>> These changes produce plots where the size of normal text matches that 
>> of mathtext.
>>
>> Thanks for you help, Mike!
>>
>> -Tony
>>
>> 
>
>   

-- 
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


Re: [Matplotlib-users] Transparent figures no longer working

2010-04-30 Thread T J
On Fri, Apr 30, 2010 at 1:55 AM, Eric Firing  wrote:
>
> I don't see this in the version as I changed it in svn r8282.  Are you sure
> you installed and built from svn after I made the change?  Using the
> attached script,  I get the two attached (gzipped) eps files. The first with
> transparent=True, has no fill operations other than for generation of the
> glyphs; the second differs from the first in having two extra fill
> operations, one for the axes patch, the other for the figure patch.
>

It looks like I messed up my install.  On top of that, when I was
testing this second time, I was not bothering to create the ps (from
latex) and just using my OS's default EPS viewer to verify that
transparency was working---the problem was that Evince displays images
on a white background rather than on some distinguishing background to
let me know that it is a transparent image.  Sorry for the noise, its
definitely working in r8282.

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


[Matplotlib-users] legend won't work with dashed lines

2010-04-30 Thread Carlos Grohmann
Hi all,

I'm wirking on a wxpython app, and I realized that the legend of a
matplotlib plot only works with solid lines. If I change the
linestyles to dashed, dotted or dashdot, it gives an error:

Traceback (most recent call last):
  File "/home/guano/Arbeit/Stout/StereoPanel.py", line 551, in PlotChecked
self.stereoCanvas.draw()
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_wxagg.py",
line 59, in draw
FigureCanvasAgg.draw(self)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
line 314, in draw
self.figure.draw(self.renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
  File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 774, in draw
for a in self.axes: a.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
  File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1721, in draw
a.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
  File "/usr/lib/pymodules/python2.6/matplotlib/legend.py", line 386, in draw
self._legend_box.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw
c.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw
c.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw
c.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in draw
c.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 488, in draw
c.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
in draw_wrapper
draw(artist, renderer, *kl)
  File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 535, in draw
drawFunc(renderer, gc, tpath, affine.frozen())
  File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 874,
in _draw_lines
self._lineFunc(renderer, gc, path, trans)
  File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 925,
in _draw_dashed
renderer.draw_path(gc, path, trans)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
line 98, in draw_path
self._renderer.draw_path(gc, path, transform, rgbFace)
TypeError: float() argument must be a string or a number



This happens for Line2D and for LineCollection as well.

TIA

Carlos

-- 
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
Linux User #89721

Can’t stop the signal.

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


Re: [Matplotlib-users] legend won't work with dashed lines

2010-04-30 Thread Michael Droettboom
The following works for me.

   from pylab import *

   plot([1,2,3], linestyle='dashed', label='foo')
   legend()
   show()

Can you be more specific about how you create the error?

Mike

Carlos Grohmann wrote:
> Hi all,
>
> I'm wirking on a wxpython app, and I realized that the legend of a
> matplotlib plot only works with solid lines. If I change the
> linestyles to dashed, dotted or dashdot, it gives an error:
>
> Traceback (most recent call last):
>   File "/home/guano/Arbeit/Stout/StereoPanel.py", line 551, in PlotChecked
> self.stereoCanvas.draw()
>   File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_wxagg.py",
> line 59, in draw
> FigureCanvasAgg.draw(self)
>   File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
> line 314, in draw
> self.figure.draw(self.renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
> in draw_wrapper
> draw(artist, renderer, *kl)
>   File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 774, in draw
> for a in self.axes: a.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
> in draw_wrapper
> draw(artist, renderer, *kl)
>   File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1721, in draw
> a.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
> in draw_wrapper
> draw(artist, renderer, *kl)
>   File "/usr/lib/pymodules/python2.6/matplotlib/legend.py", line 386, in draw
> self._legend_box.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in 
> draw
> c.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in 
> draw
> c.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in 
> draw
> c.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 224, in 
> draw
> c.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/offsetbox.py", line 488, in 
> draw
> c.draw(renderer)
>   File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46,
> in draw_wrapper
> draw(artist, renderer, *kl)
>   File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 535, in draw
> drawFunc(renderer, gc, tpath, affine.frozen())
>   File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 874,
> in _draw_lines
> self._lineFunc(renderer, gc, path, trans)
>   File "/usr/lib/pymodules/python2.6/matplotlib/lines.py", line 925,
> in _draw_dashed
> renderer.draw_path(gc, path, trans)
>   File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
> line 98, in draw_path
> self._renderer.draw_path(gc, path, transform, rgbFace)
> TypeError: float() argument must be a string or a number
>
>
>
> This happens for Line2D and for LineCollection as well.
>
> TIA
>
> Carlos
>
>   

-- 
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] question about axis scale multiplier

2010-04-30 Thread Margherita Vittone wiersma
HI,
i am making a scatter plot and i simply use defaults for tick formatting etc;
when i plot the data the plot show on the x axis a multiplier scaling with 
scintific notation;
i would like to get rid of it , the data looks like this:

values5 = 
[-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
   
-102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
   
-102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
   ..]

values6 = 
[-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
   
-98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
   
-98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
   
-98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
 ]


and when the plot is shown as in the the attachement it show the scintific 
notation
at the x scale.

Any input is appreciated. Thank you much
bye for now

Margherita


HI,
i am making a scatter plot and i simply use defaults for tick formatting etc;
when i plot the data the plot show on the x axis a multiplier scaling with 
scintific notation;
i would like to get rid of it , the data looks like this:

values5 = 
[-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
   
-102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
   
-102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
   ..]

values6 = 
[-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
   
-98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
   
-98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
   
-98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
 ]


and when the plot is shown as in the the attachement it show the scintific 
notation
at the x scale.

Any input is appreciated. Thank you much
bye for now

Margherita


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


Re: [Matplotlib-users] question about axis scale multiplier

2010-04-30 Thread Eric Firing
Margherita Vittone wiersma wrote:
> HI,
> i am making a scatter plot and i simply use defaults for tick formatting etc;
> when i plot the data the plot show on the x axis a multiplier scaling with 
> scintific notation;
> i would like to get rid of it , the data looks like this:
> 
> values5 = 
> [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
>
> -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
>
> -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
>..]
> 
> values6 = 
> [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
>
> -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
>
> -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
>
> -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
>  ]
> 
> 
> and when the plot is shown as in the the attachement it show the scintific 
> notation
> at the x scale.

If it were just a matter of scientific notation, you would be able to 
use the ticklabel_format Axes method with style='plain' to turn it off. 
  The real problem, though, is that an offset is being used.  With mpl 
from svn, you can also turn that off with the ticklabel_format() 
function or method, but with released versions you need something a 
little more arcane, e.g.

import pyplot as plt
plt.scatter(values5, values6)
ax = plt.gca()
ax.xaxis.set_major_formatter(plt.ScalarFormatter(useOffset=False))
#ax.xaxis.set_major_locator(plt.MaxNLocator(nbins=6, steps=[1,2,5,10]))
plt.draw()

The commented-out line reduces the number of tick marks; you may want to 
do this because without the offset, the tick labels can get a bit long 
and crowded.

Eric


> 
> Any input is appreciated. Thank you much
> bye for now
> 
> Margherita
> 
> 
> 
> 
> 
> 
> HI,
> i am making a scatter plot and i simply use defaults for tick formatting etc;
> when i plot the data the plot show on the x axis a multiplier scaling with 
> scintific notation;
> i would like to get rid of it , the data looks like this:
> 
> values5 = 
> [-102.44,-102.51,-102.47,-102.52,-102.52,-102.51,-102.44,-102.51,-102.47
>
> -102.52,-102.52,-102.51,-102.52,-102.49,-102.51,-102.51,-102.51,-102.52
>
> -102.57,-102.46,-102.55,-102.51,-102.49,-102.51,-102.51,-102.51,-102.52
>..]
> 
> values6 = 
> [-98.58,-98.48,-98.5,-98.47,-98.52,-98.48,-98.58,-98.48,-98.5,-98.47,-98.52,
>
> -98.48,-98.48,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,
>  
> -98.55,-98.48,-98.48,-98.53,-98.48,-98.52,-98.58,-98.58,-98.47,-98.55,
>  
> -98.53,-98.48,-98.47,-98.42,-98.48,-98.45,-98.47,-98.52,-98.45,-98.58,
>  ]
> 
> 
> and when the plot is shown as in the the attachement it show the scintific 
> notation
> at the x scale.
> 
> Any input is appreciated. Thank you much
> bye for now
> 
> Margherita
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> 
> 
> 
> 
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


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