Pregunta

I used Google and searched on stackexchange, stackoverflow. How can I reproduce the plots from http://gnuplot.sourceforge.net/demo/simple.html with the colors from there?

Using the given script

# set terminal pngcairo  transparent enhanced font "arial,10" fontscale 1.0 size 500, 350 
# set output 'simple.1.png'
set key inside left top vertical Right noreverse enhanced autotitles box linetype -1 linewidth 1.000
set samples 50, 50
plot [-10:10] sin(x),atan(x),cos(atan(x))

on gnuplot (windows 7) always produce a plot with the colors green, red, blue: http://imageshack.us/photo/my-images/23/unbenanntfkh.png/

I know that I can specify the colors for every single function. Where can I change (global) the colors in my plots?

¿Fue útil?

Solución

You can use set linetype to define the default linetypes.

set linetype 1 lc rgb "blue"
set linetype 2 lc rgb "#EE5500"  

" The set linetype command allows you to redefine the basic linetypes used for plots. The command options are identical to those for "set style line". Unlike line styles, redefinitions by set linetype are persistent; they are not affected by reset."

To load your settings on every gnuplot session automatically, just put these commands in the gnuplot config file, which is .gnuploton linux/unix or GNUPLOT.INIon windows:

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top