Skip to content

Commit 97240b8

Browse files
committed
splot++
1 parent 07460f4 commit 97240b8

7 files changed

+80
-29
lines changed

README.adoc

+6-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,14 @@ Minimal explained Gnuplot examples. Compiled outputs: http://www.cirosantilli.co
4242
.... link:multiple-blocks-inline.gnuplot[]
4343
.... link:multiple-blocks-headeres.gnuplot[]
4444
... link:inline-data.gnuplot[Inline data]
45-
... link:samples.gnuplot[Samples]
45+
... Plot functions
46+
.... link:samples.gnuplot[Samples]
4647
.. link:object-circle.gnuplot[object circle]
4748
.. link:intervals.gnuplot[Intervals]
4849
.. 3D
49-
... link:splot.gnuplot[splot]
50-
... link:pm3d.gnuplot[]
50+
... link:splot.gnuplot[]
51+
... link:splot-data-linear.gnuplot[]
52+
... Heatmap
53+
.... link:heatmap.gnuplot[]
5154
.. link:animation.gif.gnuplot[GIF animation]
5255
.. link:interactive/[Interactive]

heatmap.gnuplot

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env gnuplot
2+
3+
## pm3d
4+
5+
## Heat maps
6+
7+
# Palette mapped 3D.
8+
9+
# Represent the third dimension as color, and fill in the entire image.
10+
11+
set size ratio -1
12+
set view map
13+
set samples 5
14+
set isosamples 20
15+
set urange [-5.0 : 5.0]
16+
set vrange [-10.0 : 10.0]
17+
set xrange [-10.0 : 10.0]
18+
set yrange [-15.0 : 15.0]
19+
splot '++' using 1:2:($1**2 + $2**2) notitle with pm3d

pm3d.gnuplot

-16
This file was deleted.

samples.gnuplot

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
#!/usr/bin/env gnuplot
22

33
## samples
4-
4+
#
55
# Set the number of points for analytical function plots.
6-
6+
#
77
# Different samples for different functions:
88
# http://stackoverflow.com/questions/19524582/different-number-of-samples-for-different-functions
99

1010
set key off
1111
set samples 10
12-
plot x with points
13-
14-
# TODO: how to set multiple sample rates?
15-
# replot here also replots the first one.
16-
#set samples 20
17-
#replot sin(x) + 1 with points
12+
plot [-3:3] sin(x) with linespoints

splot-data-linear.dat

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-3 1 9
2+
-3 2 9
3+
-3 3 9
4+
5+
-2 1 4
6+
-2 2 4
7+
-2 3 4
8+
9+
-1 1 1
10+
-1 2 1
11+
-1 3 1
12+
13+
0 1 0
14+
0 2 0
15+
0 3 0
16+
17+
1 1 1
18+
1 2 1
19+
1 3 1
20+
21+
2 1 4
22+
2 2 4
23+
2 3 4
24+
25+
3 1 9
26+
3 2 9
27+
3 3 9

splot-data-linear.gnuplot

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env gnuplot
2+
set hidden3d
3+
set xyplane at 0
4+
splot "splot-data-linear.dat" notitle with lines

splot.gnuplot

+21-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
## splot
44

5-
## 3D plot
5+
set terminal png
6+
set output 'splot-domain.png'
67

7-
splot x**2 + y**2
8+
# Number of x and y samples.
9+
set isosamples 10, 5
10+
11+
# Plotted domain.
12+
# https://stackoverflow.com/questions/51529014/gnuplot-plot-range-different-from-axes-range/62728206#62728206
13+
set urange [-5.0 : 0.0]
14+
set vrange [-5.0 : 5.0]
15+
16+
# Visible domain.
17+
set xrange [-5.0 : 5.0]
18+
set yrange [-5.0 : 5.0]
19+
20+
# Just to make plot look nicer.
21+
set hidden3d
22+
set xyplane at 0
23+
set xlabel 'x'
24+
set ylabel 'y'
25+
26+
splot '++' using 1:2:($2**2) with lines

0 commit comments

Comments
 (0)