Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| software:gnuplot [2013/10/09 10:53] cyril [Plot data from a file] | software:gnuplot [2024/04/19 09:54] (current) cyril autotitle | ||
|---|---|---|---|
| Line 59: | Line 59: | ||
| set x2label "" | set x2label "" | ||
| set y2label "" | set y2label "" | ||
| + | </ | ||
| + | |||
| + | * Log scale.< | ||
| + | set logscale x 2 | ||
| + | set logscale y 10 | ||
| </ | </ | ||
| Line 69: | Line 74: | ||
| set key left bottom | set key left bottom | ||
| set key 100,100 | set key 100,100 | ||
| + | </ | ||
| + | |||
| + | * Automatic legend.< | ||
| + | set key autotitle columnheader | ||
| </ | </ | ||
| Line 137: | Line 146: | ||
| * **every** Specifying lines to use (every 2 lines from line 50 to line 1050).< | * **every** Specifying lines to use (every 2 lines from line 50 to line 1050).< | ||
| plot " | plot " | ||
| + | </ | ||
| + | |||
| + | * **separator** Set the field separator:< | ||
| + | set datafile separator "," | ||
| </ | </ | ||
| Line 159: | Line 172: | ||
| plot " | plot " | ||
| plot " | plot " | ||
| + | </ | ||
| + | |||
| + | * **palette** Colors as value.< | ||
| + | set palette defined (0 " | ||
| + | plot " | ||
| </ | </ | ||
| Line 190: | Line 208: | ||
| </ | </ | ||
| - | * **($1)** Arithmetics on columns.< | + | * **($1)** Arithmetics on columns | 
| plot " | plot " | ||
| # where $n means column n | # where $n means column n | ||
| + | </ | ||
| + | |||
| + | * **(column())** Arithmetics on columns indices.< | ||
| + | plot i=1, " | ||
| </ | </ | ||
| Line 203: | Line 225: | ||
| plot " | plot " | ||
| + | </ | ||
| + | |||
| + | * **word()** Define array variables.< | ||
| + | colors=" | ||
| + | print word(colors, | ||
| </ | </ | ||
| Line 214: | Line 241: | ||
| plot for [file in " | plot for [file in " | ||
| </ | </ | ||
| - | plot for [i=1:3] run.dat using i | + | plot for [i=1:3] run.dat using i t sprintf(" | 
| </ | </ | ||
| file(n) = sprintf(" | file(n) = sprintf(" | ||
| Line 277: | Line 304: | ||
| * or anything else with shell commands... | * or anything else with shell commands... | ||
| + | |||
| + | * **fit** a function to data:< | ||
| + | f(x) = a*x**2 + b*x + c | ||
| + | fit f(x) " | ||
| + | plot " | ||
| + | </ | ||
| * **sh** Passing arguments to a gnuplot script. | * **sh** Passing arguments to a gnuplot script. | ||
| Line 428: | Line 461: | ||
| </ | </ | ||
| - | * Progressive display (but the plot is not really | + | * Progressive display (but the plot is not interactive anymore)< | 
| plot " | plot " | ||
| - | while(1) { replot ; pause 0.1 } | + | while(1) { replot ; pause 0.2 } | 
| </ | </ | ||
| - | * Pausing and resuming the progressive display for interactivity (only works with x11 terminal).< | + | * Pausing and resuming the progressive display for interactivity (only works with x11 terminal | 
| set terminal x11 | set terminal x11 | ||
| bind " | bind " | ||
| plot " | plot " | ||
| update=1 | update=1 | ||
| - | while(update) { replot ; pause 0.1 } | + | while(update) { replot ; pause 0.2 } | 
| </ | </ | ||




