File: matrix_every.dem

package info (click to toggle)
gnuplot 6.0.2%2Bdfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 14,940 kB
  • sloc: ansic: 95,319; cpp: 7,590; makefile: 2,470; javascript: 2,328; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (53 lines) | stat: -rw-r--r-- 1,095 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# Exercise use of 'every' subsampling with image plots
# This was a regression in 5.0.3 
#

$Matrix << EOM
3 3 3 3 3 3 3
3 4 4 4 4 4 3
3 4 5 5 5 4 3
3 4 5 6 5 4 3
3 4 5 5 5 4 3
3 4 4 4 4 4 3
3 3 3 3 3 3 3
EOM

unset key
set ticscale 0
set border 0
set xrange [-0.5:6.5]
set yrange [-0.5:6.5]
set grid lt -1
set cbrange [3:6]
unset colorbox
set style textbox opaque

set multiplot layout 2,2

set title "Full 7x7 matrix"
plot $Matrix matrix with image

set title "Subsample columns by every ::2::4"
stats $Matrix every ::2::4 matrix noout
set xlabel sprintf("%d x %d submatrix", STATS_size_x, STATS_size_y)
set xlabel offset 0,1.5 boxed
plot $Matrix every ::2::4 matrix with image

set title "Subsample rows by every :::2::4"
stats $Matrix every :::2::4 matrix noout
set xlabel sprintf("%d x %d submatrix", STATS_size_x, STATS_size_y)
set xlabel offset 0,1.5 boxed
plot $Matrix every :::2::4 matrix with image
set title "Sample alternate columns by every 2"

set xtics 2
set xrange [-1:7]
unset xlabel
plot $Matrix every 2 matrix with image

unset multiplot

pause -1 "<cr> to continue"

reset