"minvalue must be less than or equal to maxvalue" error

Hello all,
i created some program to read from netcdf files and plot the data, and it
seems to work ok. But when i try to run an older file, it just shows this:

Traceback (most recent call last):
  File "netcdf2png.py", line 199, in <module>
    savefig("range.png")
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 356, in
savefig
    return fig.savefig(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 1032, in
savefig
    self.canvas.print_figure(*args, **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py", line
1476, in print_figure
    **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py",
line 358, in print_png
    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, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/figure.py", line 773, 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, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/axes.py", line 1735, in draw
    a.draw(renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 704,
in draw
    return Collection.draw(self, renderer)
  File "/usr/lib/pymodules/python2.6/matplotlib/artist.py", line 46, in
draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 201,
in draw
    self.update_scalarmappable()
  File "/usr/lib/pymodules/python2.6/matplotlib/collections.py", line 477,
in update_scalarmappable
    self._facecolors = self.to_rgba(self._A, self._alpha)
  File "/usr/lib/pymodules/python2.6/matplotlib/cm.py", line 166, in to_rgba
    x = self.norm(x)
  File "/usr/lib/pymodules/python2.6/matplotlib/colors.py", line 825, in
__call__
    raise ValueError("minvalue must be less than or equal to maxvalue")
ValueError: minvalue must be less than or equal to maxvalue

Any ideas?
Thx in advance

···

--
View this message in context: http://old.nabble.com/"minvalue-must-be-less-than-or-equal-to-maxvalue"-error-tp31422145p31422145.html
Sent from the matplotlib - users mailing list archive at Nabble.com.

My best guess is that there is something messing up the colormap normalization. Without knowing more about your program and the data being plotted, I can’t say more.

Ben Root

···

On Mon, Apr 18, 2011 at 4:25 AM, Muffles <dantaresrah@…985…> wrote:

Hello all,

i created some program to read from netcdf files and plot the data, and it

seems to work ok. But when i try to run an older file, it just shows this:

Traceback (most recent call last):

File “netcdf2png.py”, line 199, in

savefig("range.png")

File “/usr/lib/pymodules/python2.6/matplotlib/pyplot.py”, line 356, in

savefig

return fig.savefig(*args, **kwargs)

File “/usr/lib/pymodules/python2.6/matplotlib/figure.py”, line 1032, in

savefig

self.canvas.print_figure(*args, **kwargs)

File “/usr/lib/pymodules/python2.6/matplotlib/backend_bases.py”, line

1476, in print_figure

**kwargs)

File “/usr/lib/pymodules/python2.6/matplotlib/backends/backend_agg.py”,

line 358, in print_png

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, *args, **kwargs)

File “/usr/lib/pymodules/python2.6/matplotlib/figure.py”, line 773, 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, *args, **kwargs)

File “/usr/lib/pymodules/python2.6/matplotlib/axes.py”, line 1735, in draw

a.draw(renderer)

File “/usr/lib/pymodules/python2.6/matplotlib/collections.py”, line 704,

in draw

return Collection.draw(self, renderer)

File “/usr/lib/pymodules/python2.6/matplotlib/artist.py”, line 46, in

draw_wrapper

draw(artist, renderer, *args, **kwargs)

File “/usr/lib/pymodules/python2.6/matplotlib/collections.py”, line 201,

in draw

self.update_scalarmappable()

File “/usr/lib/pymodules/python2.6/matplotlib/collections.py”, line 477,

in update_scalarmappable

self._facecolors = self.to_rgba(self._A, self._alpha)

File “/usr/lib/pymodules/python2.6/matplotlib/cm.py”, line 166, in to_rgba

x = self.norm(x)

File “/usr/lib/pymodules/python2.6/matplotlib/colors.py”, line 825, in

call

raise ValueError("minvalue must be less than or equal to maxvalue")

ValueError: minvalue must be less than or equal to maxvalue

Any ideas?

Thx in advance