How to set a line style as default for multiple plots in Gnuplot?

前端 未结 2 1871
无人及你
无人及你 2021-02-06 00:42

I would like to create plot using gnuplot. The line width should be 3 in all plots. If I do it for one plot only this is done by:

set style line 1 linewidth 3


        
相关标签:
2条回答
  • 2021-02-06 01:13

    There are also other "line styles" that are set for all lines at once without index, e.g., for linespoints:

    set style data linespoints
    plot '-', '-'
        1, 1
        2, 2
        3, 3
        e
        1, 1
        2, 4
        3, 9
        e
    

    Have a look at the "Style" section of the TOC of the manual http://www.gnuplot.info/docs_5.0/gnuplot.pdf for other things that can be set by default.

    0 讨论(0)
  • 2021-02-06 01:19

    You can specify

    set terminal <terminal> linewidth 3
    

    This will change the default linewidth for all lines in the plot, including the plot borders.

    If that's not what you want, you can specify all the lines in a loop (gnuplot 4.6+), where n is the number of lines you are plotting:

    do for [i=1:n] {
        set style line i linewidth 3
    }
    
    0 讨论(0)
提交回复
热议问题