Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: sfeam Newsgroups: comp.graphics.apps.gnuplot Subject: Re: 2d plot with varying line color Followup-To: comp.graphics.apps.gnuplot Date: Wed, 01 Jun 2011 11:19:28 -0700 Organization: gnuplot development team Lines: 37 Message-ID: References: Reply-To: sfeam@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7Bit Injection-Date: Wed, 1 Jun 2011 18:19:30 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="joalffpZlyHxFtpFd/PRrw"; logging-data="12653"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+xuaoUiNeWVPOsqKpHdzB5" User-Agent: KNode/4.4.9 Cancel-Lock: sha1:DY17rY/vxNKSrxs1LxP257zjrGY= Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:352 antia wrote: > Hi all, > I would like to make an ordinary 2D plot of a function where the line > color smoothly changes along a gradient or palette. Is this possible? No, but... > I know similar things can be done for 3D plots ... You can use a 2D projection of a 3D plot for this. See "help special-filenames" > A minimal code of what I am trying to plot is: > > -- > plot erf(x) notitle with lines > -- set xrange [-5:5] set yrange [-1:1] set view map splot '++' using 1:(erf($1)):(erf($1)) with lines lc palette That gets you the plot you want with colors assigned from gnuplot's default black->blue->orange->yellow palette. For examples of other palette definitions, see "help palette" or http://gnuplot.sourceforge.net/demo_cvs/pm3dcolors.html > > I would like the erf function to be red for low values of x and move > towards blue on high values of x, i.e. I would like a temperature-like > scale. > > Thanks for any help!