Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

334
Visualizações
gnuplot line type does not want to be changed

Can you help me please? I want change one line type to dotted. I use these comannds:

gnuplot> set terminal png size 750,210 nocrop butt font "/usr/share/fonts/truetype/ttf-liberation/LiberationSans-Regular.ttf" 8
gnuplot> set output "/root/data.png"
gnuplot> set xdata time
gnuplot> set timefmt "%Y-%m-%d"
gnuplot> set format x "%b %d"
gnuplot> set ylabel "item1"
gnuplot> set y2label "item2"
gnuplot> set y2tics
gnuplot> set datafile separator "|"
gnuplot> plot "/root/results.txt" using 1:2 title "item1" w lines lt 4, "/root/results.txt" using 1:3 title "item2" with lines

But I allways get only magenta color line. I have used Version 4.6 patchlevel 0. Thanks for replies.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

There are several ways to change the line colors using set commands:

  1. Define line styles:

    set style line 1 linetype 1 linecolor 7
    set style line 2 linetype 1 linecolor rgb "#dd7700"
    plot x linestyle 1, x**2 linestyle 2
    

    You must explicitely specify which line style is used.

  2. Choose and increment over line style instead of line type if nothing is specified:

    set style line 1 linetype 1 linecolor 7
    set style line 2 linetype 1 linecolor rgb "#dd7700"
    set style increment user
    plot x, x**2
    
  3. Redefine the default line type (introduced in version 4.6.0):

    set linetype 1 linecolor 7
    set linetype 2 linetype 1 linecolor rgb "magenta"
    plot x, x**2
    

    Beware, that unlike line styles, redefinitions by set linetype are persistent; they are not affected by reset. To reset them you must use set linetype 1 default.

So a minimal plotting script could look like:

reset
set terminal pngcairo dashed monochrome
set output "/root/data.png"
set xdata time
set timefmt "%Y-%m-%d"
set format x "%b %d"
set datafile separator "|"
set style data lines

plot "/root/results.txt" using 1:2 linetype 1, "" using 1:3 linetype 3
over 4 years ago · Santiago Trujillo Relatório

0

On the X-11 terminal I have no trouble changing the line color but have had no success changing line types to include dotted and/or dashed lines.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda