SourceForge logo
SourceForge logo
Menu

matplotlib-devel

From: Tom D. <tom...@gm...> - 2005年06月24日 15:09:59
I have been using matplotlib a few days now and think I it is great
but recently I have gotten hung up on a problem plotting negative
numbers.
I am trying to plot data where the y values are all negative. When I
do this I get the No positive data to plot error. I have tracked it
down to the following two line is
/matplotlib/ticker.py:
 if minpos<=3D0:=20
 raise RuntimeError('No positive data to plot')
It looks like for some reason Matplotlib wants positive values when it
does the axis scaling. I commented out the two lines and it works
like a charm now. My question is, do these two lines of code serve a
useful purpose. Does commenting them out break something else or is
this a change that can be incorporated back into the matplotlib
source?
Full stack trace=20
---> 33 splot.plot(x1, y1, "g", x2, y2, "r")
/home/tdennist/lib/python/matplotlib/axes.py in plot(self, *args, **kwargs)
 2524 lines.append(line)
 2525 lines =3D [line for line in lines] # consume the generator
-> 2526 self.autoscale_view()
 2527 return lines
 2528
/home/tdennist/lib/python/matplotlib/axes.py in autoscale_view(self)
 783
 784 locator =3D self.yaxis.get_major_locator()
--> 785 self.set_ylim(locator.autoscale())
 786
 787
/home/tdennist/lib/python/matplotlib/ticker.py in autoscale(self)
 819
 820 if minpos<=3D0:
--> 821 raise RuntimeError('No positive data to plot')
 822 if vmin<=3D0:
 823 vmin =3D minpos
RuntimeError: No positive data to plot
In [50]: exampleReturns.logHistogramPlot([1,2,3,4,0], 100)
From: John H. <jdh...@ac...> - 2005年07月05日 16:59:02
>>>>> "Tom" == Tom Denniston <tom...@gm...> writes:
 Tom> I have been using matplotlib a few days now and think I it is
 Tom> great but recently I have gotten hung up on a problem
 Tom> plotting negative numbers.
 Tom> I am trying to plot data where the y values are all negative.
 Tom> When I do this I get the No positive data to plot error. I
 Tom> have tracked it down to the following two line is
 Tom> /matplotlib/ticker.py: if minpos<=0: raise RuntimeError('No
 Tom> positive data to plot')
This should only be occurring if you have log scaling set. Could you
get a fresh copy of matplotlib CVS and see if you can replicate the
bug. And if so, please post a script that exposes it.
Thanks,
JDH
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /