controllo della dimensione dei plot prodotti con gnuplottex

  • Creatore
    Topic
  • #44658
    Up
    0
    Down
    ::


    Vorrei controllare le dimensioni del plot mediante due variabili di lunghezza \w e \h. Ho provato così:

    `
    \newlength{\w}
    \newlength{\h}
    \setlength{\w}{15cm}
    \setlength{\h}{10cm}
    \begin{gnuplot}[terminal=lua, terminaloptions = size {\w,\h}]
    set size 1,1
    set border lt 1 lc rgb 'gray' lw 0.5
    f(x)=log(1+exp(1)*x**2)
    Xa = -2.5
    Xb = 2.5
    Ya = -0.3
    Yb = 3
    unset zeroaxis
    unset xlabel
    unset ylabel
    set samples 200
    set grid lt 3 lc rgb “gray” lw 0.5
    set grid y2tics
    set arrow 1 from Xa,0 to Xb,0,3 head back filled lt rgb “blue” linewidth 1.000 size screen 0.018,14.000,45.000
    set arrow 2 from 0,Ya to 0,Yb,3 head back filled lt rgb “blue” linewidth 1.000 size screen 0.018,14.000,45.000
    set xrange [Xa:Xb]
    set yrange [Ya:Yb]
    set ytics 0.3
    set pointsize 5
    set xtics (“0” 0, '$-e^{-1/2}$' -0.606531, '$e^{-1/2}$' 0.606531, Xa, Xb)
    set ytics (0, '0.97' 0.693147)
    set key 1.43,2.7
    plot f(x) lt 1 lc rgb “violet” lw 5 ti '$\displaystyle e^{-2x^2-1}-1$', '< echo 0 0' ti '' with points pt 11 ps 2 lc rgb "green" lw 2, '< echo 0.606531 .693147 ' ti '' with points pt 6 ps 1.5 lc rgb "gray" lw 2, '< echo -0.606531 0.693147 ' ti '' with points pt 6 ps 1.5 lc rgb "gray" lw 2 \end{gnuplot}` ma non funziona. Il problema, forse, è dovuto a keyval. Consigli?

Visualizzazione 0 filoni di risposte
  • Autore
    Risposte
    • #44659
      Up
      0
      Down
      ::

      Vorrei controllare le dimensioni del plot mediante due variabili di lunghezza \w e \h. Ho provato così:

      `
      \newlength{\w}
      \newlength{\h}
      \setlength{\w}{15cm}
      \setlength{\h}{10cm}
      \begin{gnuplot}[terminal=lua, terminaloptions = size {\w,\h}]
      set size 1,1
      set border lt 1 lc rgb 'gray' lw 0.5
      f(x)=log(1+exp(1)*x**2)
      Xa = -2.5
      Xb = 2.5
      Ya = -0.3
      Yb = 3
      unset zeroaxis
      unset xlabel
      unset ylabel
      set samples 200
      set grid lt 3 lc rgb “gray” lw 0.5
      set grid y2tics
      set arrow 1 from Xa,0 to Xb,0,3 head back filled lt rgb “blue” linewidth 1.000 size screen 0.018,14.000,45.000
      set arrow 2 from 0,Ya to 0,Yb,3 head back filled lt rgb “blue” linewidth 1.000 size screen 0.018,14.000,45.000
      set xrange [Xa:Xb]
      set yrange [Ya:Yb]
      set ytics 0.3
      set pointsize 5
      set xtics (“0” 0, '$-e^{-1/2}$' -0.606531, '$e^{-1/2}$' 0.606531, Xa, Xb)
      set ytics (0, '0.97' 0.693147)
      set key 1.43,2.7
      plot f(x) lt 1 lc rgb “violet” lw 5 ti '$\displaystyle e^{-2x^2-1}-1$', '< echo 0 0' ti '' with points pt 11 ps 2 lc rgb "green" lw 2, '< echo 0.606531 .693147 ' ti '' with points pt 6 ps 1.5 lc rgb "gray" lw 2, '< echo -0.606531 0.693147 ' ti '' with points pt 6 ps 1.5 lc rgb "gray" lw 2 \end{gnuplot}` ma non funziona. Il problema, forse, è dovuto a keyval. Consigli?

      Ho risolto così:

      `
      \newcommand{\w}{10cm,5cm}
      \begin{gnuplot}[terminal=lua, terminaloptions = size \w]
      set size 1,1
      set border lt 1 lc rgb 'gray' lw 0.5
      f(x)=log(1+exp(1)*x**2)
      Xa = -2.5
      Xb = 2.5
      Ya = -0.3
      Yb = 3
      unset zeroaxis
      unset xlabel
      unset ylabel
      set samples 200
      set grid lt 3 lc rgb “gray” lw 0.5
      set grid y2tics
      set arrow 1 from Xa,0 to Xb,0,3 head back filled lt rgb “blue” linewidth 1.000 size screen 0.018,14.000,45.000
      set arrow 2 from 0,Ya to 0,Yb,3 head back filled lt rgb “blue” linewidth 1.000 size screen 0.018,14.000,45.000
      set xrange [Xa:Xb]
      set yrange [Ya:Yb]
      set ytics 0.3
      set pointsize 5
      set xtics (“0” 0, '$-e^{-1/2}$' -0.606531, '$e^{-1/2}$' 0.606531, Xa, Xb)
      set ytics (0, '0.97' 0.693147)
      set key 1.43,2.7
      plot f(x) lt 1 lc rgb “violet” lw 5 ti '$\displaystyle e^{-2x^2-1}-1$', '< echo 0 0' ti '' with points pt 11 ps 2 lc rgb "green" lw 2, '< echo 0.606531 .693147 ' ti '' with points pt 6 ps 1.5 lc rgb "gray" lw 2, '< echo -0.606531 0.693147 ' ti '' with points pt 6 ps 1.5 lc rgb "gray" lw 2 \end{gnuplot}`

Visualizzazione 0 filoni di risposte
  • Devi essere connesso per rispondere a questo topic.

Go to top