1

I have another problem with gnuplot, maybe someone has a good idea, what to do:

I wanted to plot some simple lines with points in black and white. Each line should get its own symbols for point but same style. Black border and white or grey on the inside, but then different shapes like circle or triangle. So far I am just able to produce the border, but inside is either completely empty/blank or I get just rounded interruptions. For my understanding this is due to the pi (pointinterval) command, but shape is always just a circle and not matching when using triangles.

My used linestyle is

set style line 1 lt -1 lw 2 pi -4 pt 17 ps 1
plot    f(x) w lp ls 1

So my questions is, how can I produce a line with points, which have a border with line color and a filled inside of any wished color?

Thought this is not too difficult, but up for now I am full-blown stuck, so thank you for any advice!

EugI
  • 43
  • 2
  • 5
  • See http://stackoverflow.com/q/31561278/2604213 – Christoph Aug 07 '15 at 04:24
  • Thanks Christoph, but anyway this seems like a workaround which is frustrating if you look for the legend with double entries for each line. I like Gnuplot for a lot of reasons, but style line styling isn't one of them. Is there no simpler way, just like defining the line and point style, even if its no preset??? – EugI Aug 07 '15 at 10:10
  • I posted the link, because this is the only generic way to do what you want. Yes, it is kind of workaround... The only terminal which allows customized point types is the `tikz` terminal (similar to the custom fill styles which I show in http://stackoverflow.com/a/23034300/2604213) – Christoph Aug 07 '15 at 11:38
  • You can choose between methods, which are described in this post: http://gnuplot-tricks.blogspot.ru/2009/12/defining-some-new-plot-styles.html – John_West Aug 07 '15 at 15:09

1 Answers1

0

Thank you Christoph and John,

looking at your suggestions, the best I can imagine so far would be something like discussed in this follow up of the Johns link: http://gnuplot-tricks.blogspot.ru/2010/03/defining-new-symbols.html For my purpose I chose a simpler version with the following

plot f(x) with lines lt -1 lw 2,\
     f(x) with points notitle lt -1 pt 5 pi 4 ps 0.8,\
     f(x) with points notitle lt 3 pt 5 pi 4 ps 0.6

So points are plotted 3 times, first just a the line, second as bigger points same color as line and third with smaller point and different color.

In general this is working, but still it remains how to get a proper key/legend. Here I prefer to have the correct line and one symbol with the circumference. As it is now legend would contain three entries or as in the example just the line without symbol.

Thinking of placing a symbol by hand as described in aboves link, but an automated version depending on different number of key entries or key position would be the better solution.

EugI
  • 43
  • 2
  • 5