GNUPlot: plot different ranges with different styles

Posted by Mr. Shickadance on Stack Overflow See other posts from Stack Overflow or by Mr. Shickadance
Published on 2011-01-11T20:43:30Z Indexed on 2011/01/11 20:54 UTC
Read the original article Hit count: 210

Filed under:

Hello all,

I know this should be pretty simple, but I haven't been able to find a similar example.

I need to plot different ranges of a datafile differently, but on the same graph.

For instance, say my datafile represents a function with x and y values. I want to plot the first N values using a style like lines, and then the next M values using a different style, like points.

I was thinking I would need a plot command similar to this:

plot [1:5] "my.data" using 1:2 with lines, [6:12] using 1:2 with points, [13:19] using 1:2 with lines

Essentially I want to distinguish different areas of the functions.

Any ideas? I am sorry if it sounds like I'm rambling but I am quite stumped.

Thanks in advance!

© Stack Overflow or respective owner

Related posts about gnuplot