knkd
knkd

Reputation: 75

Is it possible to assign different styles Gnuplot line on the graph, and the corresponding entry in the legend?

I have a data file(points.dat):

0.00    0.0
0.10    0.1
0.15    0.2
0.40    0.3
0.60    0.4
0.50    0.5
0.60    0.6
0.40    0.7
0.15    0.8
0.10    0.9
0.00    1.0

I run a gnuplot task (smoothing x(y) data with tmp file):

#!/usr/bin/env gnuplot

set terminal png size 600,400
set output "data.png"

set table '.tmp'
plot 'points.dat' using 2:1 smooth csplines
unset table

plot '.tmp' using 2:1 with lines, 'points.dat' with points pt 7

I have a two legend (key) entries:

enter image description here

but I want to merge the two:

enter image description here

I can draw a dummy linespoints outside the view window, but should be the right way.


@ Christoph comment

This is not "pure mathematics", there are some standard design graphs in technical documentation. The one who reads the report should be able to attach ruler to the graph and see the approximate value of the parameter.

Now my choise "notitle" to both plot and dummy line with title:

plot 'tmp' using 2:1 with lines lt 6 notitle, \
     'points.dat' with points lt 6 notitle,   \
     1E999 lt 6 with linespoints title "My Cool Title"

enter image description here

(Sorry if stated confusing. This all google translate.))

Upvotes: 1

Views: 242

Answers (1)

knkd
knkd

Reputation: 75

Now my choise "notitle" to both plot and dummy line with title:

plot 'tmp' using 2:1 with lines lt 6 notitle, \
     'points.dat' with points lt 6 notitle,   \
     1E999 lt 6 with linespoints title "My Cool Title"

enter image description here

Upvotes: 1

Related Questions