File: probably_tux.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 (41 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download | duplicates (4)
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
#
# Distortion of an image by plotting against probability scaled axes.
# Each pixel is re-scaled based on distance from the center, where
# the scale factor treats that distance as a Z score.
#
save_encoding = GPVAL_ENCODING
set encoding utf8

#set title "Probability axes:  Scale image pixels by distance from center treated as a Z-score"
set label 1 "Tux (probably)" font "Times:Bold" 
set label 1 at graph 0.5, 0.4 center front 

set xrange [-6:134]
set yrange [-6:134]
unset key

if (!exists("sigma")) sigma = 20.
center = 64.	# because the image is 128x128

if (!exists("ticinterval")) ticinterval = 1

f(x) = norm((x-center)/sigma)
g(x) = sigma*invnorm(x)+center
tic(x) = center + sigma * x 

set xtics ("" 64)
do for [i=-3:3:ticinterval] {
    set xtics add (sprintf("%dσ",i) tic(real(i)), "" tic(real(i)+.5) 1)
}
set ytics ("" 64)
do for [i=-3:3:ticinterval] {
    set ytics add (sprintf("%dσ",i) tic(real(i)), "" tic(real(i)+.5) 1)
}
set tics out nomirror

set nonlinear x via f(x) inverse g(x)
set nonlinear y via f(y) inverse g(y)

plot 'blutux.rgb' binary array=(128,128) flipy format='%uchar' with rgbimage pixels

set encoding save_encoding