| 1 |
--- |
| 2 |
kernelspec: |
| 3 |
display_name: gnuplot |
| 4 |
language: gnuplot |
| 5 |
name: gnuplot |
| 6 |
--- |
| 7 |
|
| 8 |
# Sample gnuplot notebook |
| 9 |
|
| 10 |
+++ |
| 11 |
|
| 12 |
## Simple plotting |
| 13 |
|
| 14 |
```{code-cell} |
| 15 |
# Plot sin and cos with different linetypes |
| 16 |
|
| 17 |
f(x) = sin(x) |
| 18 |
g(x) = cos(x) |
| 19 |
set xrange[0:2*pi] |
| 20 |
set xtics(0, "{/Symbol p}" pi , "2{/Symbol p}" 2*pi) |
| 21 |
set ytics 1 |
| 22 |
plot f(x) linewidth 2 title "sin(x)", \ |
| 23 |
g(x) linewidth 2 dashtype "--" title "cos(x)" |
| 24 |
``` |
| 25 |
|
| 26 |
## Example of line magic |
| 27 |
|
| 28 |
```{code-cell} |
| 29 |
%gnuplot inline pngcairo enhanced background rgb "#EEEEEE" size 600, 600 |
| 30 |
# Parametric plot without border |
| 31 |
|
| 32 |
reset |
| 33 |
set parametric |
| 34 |
set size ratio -1 |
| 35 |
unset border |
| 36 |
unset tics |
| 37 |
plot f(t), g(t) linewidth 2 notitle |
| 38 |
``` |