Since I have many points, it looks ugly if I draw my data set with
'linespoints.' I can go with just 'lines,' but I'd like to put
points(markers) as well at every 5 or 10 data point. I hope someone
could help me do this in gnuplot. Thank you.
Plot the file twice, once "with lines", then again "every 5 with points".
Thank you for your advice. In that case, I'm afraid my legend would be
slightly incorrect, since it can have only either "line" or "point";
however, my line will have both "line" and "point" in a plot after
drawing twice.
> Thank you for your advice. In that case, I'm afraid my legend would be
> slightly incorrect, since it can have only either "line" or "point";
> however, my line will have both "line" and "point" in a plot after
> drawing twice.
plot "datafile" w l t 'my data', "" every 5 w p t ''
should help you with the key
Stefan
Thank you, but with your suggestion, I end up with a key showing only a
line segment. Since now I can draw a line along with points at every 5
point, I'd like to have a key showing both line & point. I'm not sure
how can I do that.
what about:
plot
datafile with lines not,
datafile every 5 with points not,
1/0 with linespoints t "legend"
you'll have to add some statements so that all 3 plots use the same
color and/or pointtype, but i think it should work.
Karsten
--
Professur Modellierung und Simulation
Technische Universit�t Chemnitz, Fakult�t f�r Informatik
Stra�e der Nationen 62, Raum 366
Telefon: +49 371 531 - 37296
Thank you Karsten! That solved my problem. Now I have a perfect graph. :)
> On 2/4/2010 10:42 AM, Karsten Hentsch wrote:
>> Am 03.02.2010 12:06, schrieb K. Lee:
>>> On 2/2/2010 4:53 PM, Hans-Bernhard Bröker wrote:
>>>> K. Lee wrote:
>>>>> Hello all,
>>>>>
>>>>> Since I have many points, it looks ugly if I draw my data set with
>>>>> 'linespoints.' I can go with just 'lines,' but I'd like to put
>>>>> points(markers) as well at every 5 or 10 data point. I hope someone
>>>>> could help me do this in gnuplot. Thank you.
>>>>
>>>> Plot the file twice, once "with lines", then again "every 5 with
>>>> points".
>>>
>>> Thank you for your advice. In that case, I'm afraid my legend would be
>>> slightly incorrect, since it can have only either "line" or "point";
>>> however, my line will have both "line" and "point" in a plot after
>>> drawing twice.
>>
>> what about:
>> plot
>> datafile with lines not,
>> datafile every 5 with points not,
>> 1/0 with linespoints t "legend"
>>
>> you'll have to add some statements so that all 3 plots use the same
>> color and/or pointtype, but i think it should work.
>>
>> Karsten
>
> Thank you Karsten! That solved my problem. Now I have a perfect graph.
> :)
I'm glad you found a solution.
This is just a plug for the upcoming version gnuplot 4.4,
in which there is a new line property "pointinterval" that automates
this process. So in version 4.4 you will be able to accomplish what you
want by saying
plot datafile with linespoints pointinterval 5
Target schedule for release of 4.4 is next month, so you still have time
to try the release candidate and report problems requiring a last-minute
fix before final release :-)