How to improve the following gnu schedule?

I have the following gnu graph:

#  automobile_input.txt
#
set term png
set output "automobile.png"
#
#  Fields in each record are separated by commas.
#
set datafile separator ","

    set title "Price versus Curb weight"
    set xlabel "Price in dollars"
    set ylabel "Curb weight in pounds"
    set grid
    plot 'x' using 1:2
    quit

x is a file containing numbers such as

   1,2
   0.5,4

and etc.

I would like to make a few changes to this plot.

At the top of the graph there is "x using 1: 2", and I would like to remove this.

Finally, the most important thing: I would like to add another file, y, in the same format, which will also be plotted on the same plot, only with a different sign and color (instead of the pluses in red) for example, blue triangles. I would prefer the pluses to be circles.

+4
source share
1 answer

Omit the title of the data series using notitlethe plot line. Adding another curve will be performed as follows:

plot 'x' using 1:2 notitle, \
     'y' using 1:2 notitle

. , - :

 plot 'x' using 1:2 with points pointtype 6 linecolor rgb 'red'  title "Data X", \
      'y' using 1:2 with points pointtype 8 linecolor rgb 'blue' title "Data Y"

, , :

 plot 'x' w p pt 6 lc rgb 'red'  title "Data X", \
      'y' w p pt 8 lc rgb 'blue' title "Data Y"
+4

Source: https://habr.com/ru/post/1649593/


All Articles