5

How can I show gnuplot's default line styles (for a given output terminal)?

I see that if I define my own line style, I can show it. But it doesn't show the specification of the default styles as displayed by the test command.

gnuplot> show style line

gnuplot> set style line 44 lt 2 lc rgb "green" lw 2
gnuplot> show style line
        linestyle 44,  linetype 2 linecolor rgb "green"  linewidth 2.000 pointtype 2 pointsize default pointinterval 0

I'd like to see the specification of the default line style colors so that I can use corresponding colors in the web page that will include my plot.

Note that I am not asking "how do I draw a particular line style", or "how do I graphically display what the line styles look like" (test command). I am asking how to list the (text) description of default line styles.

1
  • 1
    With version 4.6 you cannot use show to display the definition of the default linetype. (with the upcoming 5.0 you can). If you need the colors for a special terminal, you need other ways to get the color. Commented Aug 22, 2014 at 6:06

2 Answers 2

7

With gnuplot version 5 the command show linetype 1 gives you the definition of the first default linetype.

gnuplot> show linetype 1

    linetype 1,  linecolor rgb "dark-violet"  linewidth 1.000 dashtype solid pointtype 1 pointsize default pointinterval 0

And with show linetypes you a list of all predefined linetypes:

gnuplot> show linetypes

    linetype 1,  linecolor rgb "dark-violet"  linewidth 1.000 dashtype solid pointtype 1 pointsize default pointinterval 0
    linetype 2,  linecolor rgb "#009e73"  linewidth 1.000 dashtype solid pointtype 2 pointsize default pointinterval 0
    linetype 3,  linecolor rgb "#56b4e9"  linewidth 1.000 dashtype solid pointtype 3 pointsize default pointinterval 0
    linetype 4,  linecolor rgb "#e69f00"  linewidth 1.000 dashtype solid pointtype 4 pointsize default pointinterval 0
    linetype 5,  linecolor rgb "#f0e442"  linewidth 1.000 dashtype solid pointtype 5 pointsize default pointinterval 0
    linetype 6,  linecolor rgb "#0072b2"  linewidth 1.000 dashtype solid pointtype 6 pointsize default pointinterval 0
    linetype 7,  linecolor rgb "#e51e10"  linewidth 1.000 dashtype solid pointtype 7 pointsize default pointinterval 0
    linetype 8,  linecolor rgb "black"  linewidth 1.000 dashtype solid pointtype 8 pointsize default pointinterval 0
    Linetypes repeat every 8 unless explicitly defined
Sign up to request clarification or add additional context in comments.

1 Comment

Why does show linetype 0 give an error 'tag must be > zero' when linetype 0 is a grey dotted line, as shown by the test command?
2

You can see them (visually) by using test command. From documentation (v 4.2):

"Each terminal has a default set of line and point types, which can be seen by using the command test".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.