fill - Varying filling colour in Gnuplot according to certain palette -


i want fill number of closed curves using gnuplot. result far.

enter image description here

not bad. have used code:

plot \ 'fort.40' u 1:2 smooth bezier w filledcurves lt 1 lc 4 lw 3 t 't=100 s' ,\ 'fort.30' u 1:2 smooth bezier w filledcurves lt 1 lc 3 lw 3 t 't=20 s' ,\ 'fort.20' u 1:2 smooth bezier w filledcurves lt 1 lc 2 lw 3 t 't=1 s' ,\ 'fort.10' u 1:2 smooth bezier w filledcurves lt 1 lc 1 lw 3 t 't=0' 

however, want plot 1 hundred of such curves (for physicists, want illustrate temporal evolution of circle in phase space of double pendulum). each closed curve stored 2 columns coordinates of curve in different ascii file. see, have achieved figure above 4 different filling colours set hand. generalise have smooth transition of colours, following palette. idea colour gives hint third dimension implicit in figure: time.

do know if possible @ use filling colour follows palette, instead of fixed colour? in worst case, define 100 filling styles (i create code within shell script, relatively easy automatise process), still not know whether possible assign colour based on palette, instead of colour giving hand.

edit: excellent answer @christoph, final output. leave here illustrate how powerfull gnuplot can be.

enter image description here

the filledcurves plotting style doesn't support lc palette or lc [rgb] variable, 1 use color lines.

for filledcurves can use lc palette frac <value>, <value> number in range [0:1] specifies fractional position in current palette, color taken from. requires know number of files plotting:

set style fill solid noborder plot \ 'fort.40' u 1:2 smooth bezier w filledcurves lc palette frac 1 t 't=100 s' ,\ 'fort.30' u 1:2 smooth bezier w filledcurves lc palette frac 0.6667 t 't=20 s' ,\ 'fort.20' u 1:2 smooth bezier w filledcurves lc palette frac 0.3333 t 't=1 s' ,\ 'fort.10' u 1:2 smooth bezier w filledcurves lc palette frac 0 t 't=0' 

to iterate on files use

files = 'fort.40 fort.30 fort.20 fort.10' times = '100     20      1       0' n = words(files)  set style fill solid noborder plot [i=1:words(files)] word(files, i) u 1:2 smooth bezier filledcurves lc palette frac (n-i)/(n-1.0) t sprintf('t=%s s', word(times, i) 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -