File: probably_tux.dem

package info (click to toggle)
gnuplot 5.2.6%2Bdfsg1-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,968 kB
  • sloc: ansic: 81,983; cpp: 7,323; makefile: 2,186; sh: 1,542; lisp: 667; perl: 302; pascal: 194; tcl: 88; python: 46
file content (37 lines) | stat: -rw-r--r-- 1,081 bytes parent folder | download | duplicates (2)
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
#
# 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.
#
#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