Setting linestyle of contours with negative values problem

Hello -

I tried to turn of the feature that makes contours with negative values dashed.
According to the mailinglist this should go by setting: rcParams[‘contour.negative_linestyle’]=(‘None’,‘None’)

I tried any combination of the None, None syntax, or just ‘solid’, but nothing worked.
Example shown below. I am using 0.90.1.
Thanks, Mark

from pylab import *
x,y = meshgrid(linspace(-3,3,10),linspace(-3,3,10))

rcParams[‘contour.negative_linestyle’]=(‘None’,‘None’)
contour(x,y,x,colors=‘b’)

Error message:

Traceback (most recent call last):
File “<pyshell#10>”, line 1, in ?

contour(x,y,x,colors='b')

File “C:\Python24\Lib\site-packages\matplotlib\pylab.py”, line 1777, in contour
draw_if_interactive()
File “C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py”, line 59, in draw_if_interactive

figManager.show()

File “C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py”, line 311, in show
self.canvas.draw()
File “C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py”, line 154, in draw

FigureCanvasAgg.draw(self)

File “C:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py”, line 392, in draw
self.figure.draw(renderer)
File “C:\Python24\Lib\site-packages\matplotlib\figure.py”, line 601, in draw

for a in self.axes: a.draw(renderer)

File “C:\Python24\Lib\site-packages\matplotlib\axes.py”, line 1286, in draw
a.draw(renderer)
File “C:\Python24\Lib\site-packages\matplotlib\collections.py”, line 700, in draw

transoffset)

ValueError: invalid literal for float(): None

Mark,

  As a quick workaround, try

rcParams['contour.negative_linestyle']=(6, 0)

This is a hack--using dashes with zero-length spaces.

I expect to have a better solution in svn shortly.

Eric

Mark Bakker wrote:

···

Hello -

I tried to turn of the feature that makes contours with negative values dashed.
According to the mailinglist this should go by setting: rcParams['contour.negative_linestyle']=('None','None')
I tried any combination of the None, None syntax, or just 'solid', but nothing worked.
Example shown below. I am using 0.90.1.
Thanks, Mark

from pylab import *
x,y = meshgrid(linspace(-3,3,10),linspace(-3,3,10))
rcParams['contour.negative_linestyle']=('None','None')
contour(x,y,x,colors='b')

Error message:

Traceback (most recent call last):
  File "<pyshell#10>", line 1, in ?
    contour(x,y,x,colors='b')
  File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 1777, in contour
    draw_if_interactive()
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 59, in draw_if_interactive
    figManager.show()
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 311, in show
    self.canvas.draw()
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 154, in draw
    FigureCanvasAgg.draw(self)
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py", line 392, in draw
    self.figure.draw(renderer)
  File "C:\Python24\Lib\site-packages\matplotlib\figure.py", line 601, in draw
    for a in self.axes: a.draw(renderer)
  File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 1286, in draw
    a.draw(renderer)
  File "C:\Python24\Lib\site-packages\matplotlib\collections.py", line 700, in draw
    transoffset)
ValueError: invalid literal for float(): None

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Mark,

Presumably the mailing list method worked at one time, but it would be obscure and unintuitive even if it worked now. There are no other explicit dash styles given as a pair of numbers in the rc file, so the change I made in svn is to use the strings "solid" and "dashed"; the two-float specification is deprecated.

Eric

Mark Bakker wrote:

···

Hello -

I tried to turn of the feature that makes contours with negative values dashed.
According to the mailinglist this should go by setting: rcParams['contour.negative_linestyle']=('None','None')
I tried any combination of the None, None syntax, or just 'solid', but nothing worked.
Example shown below. I am using 0.90.1.
Thanks, Mark

from pylab import *
x,y = meshgrid(linspace(-3,3,10),linspace(-3,3,10))
rcParams['contour.negative_linestyle']=('None','None')
contour(x,y,x,colors='b')

Error message:

Traceback (most recent call last):
  File "<pyshell#10>", line 1, in ?
    contour(x,y,x,colors='b')
  File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 1777, in contour
    draw_if_interactive()
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 59, in draw_if_interactive
    figManager.show()
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 311, in show
    self.canvas.draw()
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", line 154, in draw
    FigureCanvasAgg.draw(self)
  File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py", line 392, in draw
    self.figure.draw(renderer)
  File "C:\Python24\Lib\site-packages\matplotlib\figure.py", line 601, in draw
    for a in self.axes: a.draw(renderer)
  File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 1286, in draw
    a.draw(renderer)
  File "C:\Python24\Lib\site-packages\matplotlib\collections.py", line 700, in draw
    transoffset)
ValueError: invalid literal for float(): None

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

------------------------------------------------------------------------

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

Works for me.
Thanks, Mark

···

On 6/11/07, Eric Firing <efiring@…202…> wrote:

Mark,

Presumably the mailing list method worked at one time, but it would be
obscure and unintuitive even if it worked now. There are no other
explicit dash styles given as a pair of numbers in the rc file, so the

change I made in svn is to use the strings “solid” and “dashed”; the
two-float specification is deprecated.

Eric

Mark Bakker wrote:

Hello -

I tried to turn of the feature that makes contours with negative values

dashed.
According to the mailinglist this should go by setting:
rcParams[‘contour.negative_linestyle’]=(‘None’,‘None’)
I tried any combination of the None, None syntax, or just ‘solid’, but

nothing worked.
Example shown below. I am using 0.90.1.
Thanks, Mark

from pylab import *
x,y = meshgrid(linspace(-3,3,10),linspace(-3,3,10))
rcParams[‘contour.negative_linestyle’
]=(‘None’,‘None’)
contour(x,y,x,colors=‘b’)

Error message:

Traceback (most recent call last):
File “<pyshell#10>”, line 1, in ?

contour(x,y,x,colors='b')

File “C:\Python24\Lib\site-packages\matplotlib\pylab.py”, line 1777,
in contour
draw_if_interactive()
File
“C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py”,

line 59, in draw_if_interactive
figManager.show()
File
“C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py”,
line 311, in show
self.canvas.draw
()
File
“C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py”,
line 154, in draw
FigureCanvasAgg.draw(self)
File
“C:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py”, line

392, in draw
self.figure.draw(renderer)
File “C:\Python24\Lib\site-packages\matplotlib\figure.py”, line 601,
in draw
for a in self.axes: a.draw(renderer)
File “C:\Python24\Lib\site-packages\matplotlib\axes.py”, line 1286, in

draw
a.draw(renderer)
File “C:\Python24\Lib\site-packages\matplotlib\collections.py”, line
700, in draw
transoffset)
ValueError: invalid literal for float(): None



This SF.net email is sponsored by DB2 Express

Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/



Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users