gnuplot:没有足够的列可变颜色(gnuplot: Not enough columns for variable color)

编程入门 行业动态 更新时间:2024-10-27 06:31:52
gnuplot:没有足够的列可变颜色(gnuplot: Not enough columns for variable color)

我正在执行以下gnuplot脚本:

set title "Efficiency scatter plot" set xlabel "perf_1" set ylabel "secondary report" set log x set log y set xrange [0.1:40.0] set yrange [0.1:40.0] set terminal png medium set output "./graph1.png" set size square set multiplot set pointsize 0.3 set style line 6 pt 6 set datafile separator "," set border 3 set xtics nomirror set ytics nomirror plot '/tmp/data.csv' using 3:1 with points pt 1 lt 3 lc var title "perf_20140113131309", \ '/tmp/data.csv' using 3:2 with points pt 1 lt 1 lc var title "perf_1" plot x notitle plot 2*x notitle plot 0.5*x notitle

获取以下错误消息

"script.gnuplot", line 20: Not enough columns for variable color

你可以指导我,以便找到我做错了什么。

顺便说一下,gnuplot版本是'4.6 patchlevel 3',使用的是data.csv文件

0.1,0.1,40.0 0.14,0.14,40.0 0.32,0.32,40.0 0.7,0.74,40.0

提前致谢!

I am executing the following gnuplot script:

set title "Efficiency scatter plot" set xlabel "perf_1" set ylabel "secondary report" set log x set log y set xrange [0.1:40.0] set yrange [0.1:40.0] set terminal png medium set output "./graph1.png" set size square set multiplot set pointsize 0.3 set style line 6 pt 6 set datafile separator "," set border 3 set xtics nomirror set ytics nomirror plot '/tmp/data.csv' using 3:1 with points pt 1 lt 3 lc var title "perf_20140113131309", \ '/tmp/data.csv' using 3:2 with points pt 1 lt 1 lc var title "perf_1" plot x notitle plot 2*x notitle plot 0.5*x notitle

obtaining the following error message

"script.gnuplot", line 20: Not enough columns for variable color

Could you please guide me in order to find what I am doing wrong.

By the way the gnuplot version is '4.6 patchlevel 3' the data.csv files used is

0.1,0.1,40.0 0.14,0.14,40.0 0.32,0.32,40.0 0.7,0.74,40.0

Thanks in advance!

最满意答案

这意味着,您需要在using语句中再指定一列:第一个是x -coordinate,第二个是y -coordinate。 缺少可变线条颜色的那个。

使用例如

plot '/tmp/data.csv' using 3:1:0 with points pt 1 lt 3 lc var

使用行号(第0列)作为linetype索引。 您也可以使用例如linecolor palette因此从当前定义的调色板中选择颜色。

That means, that you need to specify one more column in your using statement: The first one is the x-coordinate, the second one the y-coordinate. The one for the variable line color is missing.

Use e.g.

plot '/tmp/data.csv' using 3:1:0 with points pt 1 lt 3 lc var

to use the row number (zeroth column) as linetype index. You can also use e.g. linecolor palette so select the color from the currently defined color palette.

更多推荐

本文发布于:2023-07-22 14:06:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1220592.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:没有足够   颜色   gnuplot   color   variable

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!