質問

I have a dataset consisting of two columns in a file. Is it possible to have different markers for each data point when plotting them?

I know I could do this by doing a BASH for loop generating a string of plot commands, but I was wondering if there is any way of doing it directly in gnuplot?

I was thinking something like marker type 1 for first data point, marker type 2 for the second data point, and so on.

役に立ちましたか?

解決

To change the linecolor or the point size based on a column's value (or the row number), gnuplot knows the linecolor variable and pointsize variable parameters. However, that doesn't work for pointtype.

Gnuplot itself has some kinds of iteration loops. You would need to count your rows with stats and then iterate over each row using the loop variable and every:

stats 'myfile' nooutput
N = int(STATS_records-1)

plot for [i=0:N] 'myfile' every ::i::i pointtype (i+1)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top