首页 > 解决方案 > Gnuplot 用线条颜色设置绘图

问题描述

我遇到了一个我无法克服的奇怪问题。我将 4 个文件中的数据绘制成 1 个文件,我希望每个图都有不同的线条颜色。但是命令lt #some number不起作用,它提供不同的线型,但从不提供颜色。我正在使用一个脚本来制作一个文件,在 gnuplot 中通过管道将其生成一个 .ps 文件。

set terminal postscript
set encoding iso_8859_1
set title 'energy difference for a polymer'
set xlabel 'n, polymer length'
set ylabel '{/Symbol D}E, eV'
set key bottom left
set xzeroaxis
set output 'deltaE_PQL.ps'
set boxwidth 0.9 relative
set style fill solid 1.0
plot 'deltaE_plotm2' u 1:2 with lines lt 1 title '| -2 {/Symbol \361}', \
'deltaE_plotm1' u 1:2 with lines lt 2 title '| -1 {/Symbol \361}', \
'deltaE_plot1' u 1:2 with lines lt 3 title '| 1 {/Symbol \361}', \
'deltaE_plot2' u 1:2 with lines lt 4 title '| 2 {/Symbol \361}'

欣赏这里有什么问题的任何想法。

标签: colorsgnuplot

解决方案


在 gnuplot 控制台中输入并检查help postscript和使用:

set terminal postscript color

推荐阅读