gnuplot legend overlaps graph

后端 未结 4 1034
萌比男神i
萌比男神i 2021-02-02 06:50

Essentially, the problem that I am experiencing is that the legend overlaps the gnuplot graph that I am trying to plot as illustrated in the following diagram.

相关标签:
4条回答
  • 2021-02-02 07:14

    With the gnuplot version 5.2 and maybe later, you can use

    set key at x, y
    

    where x and y are the values for the x-axis and y-axis respectively

    0 讨论(0)
  • 2021-02-02 07:21

    You can control location of the key by providing a set of coordinates:

    set key at 25., 5000.
    

    These values correspond to the data coordinate system. Alternatively, you can specify graph coordinates:

    set key at graph 0.1, 0.9
    

    (close to top-left position).

    0 讨论(0)
  • 2021-02-02 07:36

    You could move the legend outside the plotting area, then they definitely wouldn't overlap:

    gnuplot> set key outside
    

    See here for many more options regarding the placement of the legend or key: http://gnuplot.sourceforge.net/docs_4.2/node192.html

    0 讨论(0)
  • 2021-02-02 07:40

    If you want to turn it off altogether:

    gnuplot> set nokey
    

    If you want to move the legend, you can do this with

    gnuplot> set key left top
    

    to move it to the top left. If you want to give the lines more meaningful names in the legend, use the title keyword when generating the plot:

    gnuplot> plot "datafile1.txt" using 2:4 with lines title "data",
    ....
    
    0 讨论(0)
提交回复
热议问题