SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Nat E. <nat...@gm...> - 2011年03月30日 23:32:33
I wanted to display a line plot with rainbow coloring based on the y-value,
similar to what's possible for surface plots. However, the 'plot' method
does not appear to accept a 'cmap' argument. The closest thing I was able
to find was a recipe for different colored line segments on the SciPy
examples page (http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine),
but that's not really what I want - I was hoping for a continuous gradient
over hundreds (possibly thousands) of points on a line. Is this possible
without too much hacking?
thanks,
Nat
From: Eric F. <ef...@ha...> - 2011年03月31日 00:00:15
On 03/30/2011 01:32 PM, Nat Echols wrote:
> I wanted to display a line plot with rainbow coloring based on the
> y-value, similar to what's possible for surface plots. However, the
> 'plot' method does not appear to accept a 'cmap' argument. The closest
> thing I was able to find was a recipe for different colored line
> segments on the SciPy examples page
> (http://www.scipy.org/Cookbook/Matplotlib/MulticoloredLine), but that's
> not really what I want - I was hoping for a continuous gradient over
> hundreds (possibly thousands) of points on a line. Is this possible
> without too much hacking?
I don't think there is anything better than the second example here:
http://matplotlib.sourceforge.net/examples/pylab_examples/multicolored_line.html
Eric
>
> thanks,
> Nat
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 によって変換されたページ (->オリジナル) /