5f892713c3 2021-03-03 1: ###################################
5f892713c3 2021-03-03 2: # GNUPLOT PLOTTING
5f892713c3 2021-03-03 3: ###################################
5f892713c3 2021-03-03 4:
5f892713c3 2021-03-03 5: # IMPORTANT: This file is for use in Plot
5f892713c3 2021-03-03 6: # mode.
5f892713c3 2021-03-03 7:
5f892713c3 2021-03-03 8: reset
5f892713c3 2021-03-03 9: unset title
5f892713c3 2021-03-03 10: set label 1 "Kuen's Surface" at screen 0.6, 0.9
5f892713c3 2021-03-03 11: set output "Kuen's Surface"
5f892713c3 2021-03-03 12: set label 1 font "frscript,25"
5f892713c3 2021-03-03 13: set style line 3 linetype -1 linewidth 0.5
5f892713c3 2021-03-03 14: set pm3d depthorder hidden3d 3
5f892713c3 2021-03-03 15: set style fill transparent solid 0.65 border
5f892713c3 2021-03-03 16: set palette
5f892713c3 2021-03-03 17: set hidden3d
5f892713c3 2021-03-03 18: set ticslevel 0
5f892713c3 2021-03-03 19: unset xtics
5f892713c3 2021-03-03 20: unset ytics
5f892713c3 2021-03-03 21: unset ztics
5f892713c3 2021-03-03 22: unset border
5f892713c3 2021-03-03 23: unset colorbox
5f892713c3 2021-03-03 24: unset key
5f892713c3 2021-03-03 25: set lmargin at screen 0.1
5f892713c3 2021-03-03 26: set bmargin at screen 0.1
5f892713c3 2021-03-03 27: set rmargin at screen 0.9
5f892713c3 2021-03-03 28: set tmargin at screen 0.9
5f892713c3 2021-03-03 29: set parametric
5f892713c3 2021-03-03 30: set dummy u,v
5f892713c3 2021-03-03 31: set urange [-4.5:4.5]
5f892713c3 2021-03-03 32: set vrange [0.05:pi-0.05]
5f892713c3 2021-03-03 33: set isosamples 51,51
5f892713c3 2021-03-03 34: set view 122, 357, 1.35, 1.08
5f892713c3 2021-03-03 35: a = 1.0
5f892713c3 2021-03-03 36: x(u,v) = 2.*a*(cos(u)+u*sin(u))*sin(v) / (1+u**2.*(sin(v))**2)
5f892713c3 2021-03-03 37: y(u,v) = 2.*a*(sin(u)-u*cos(u))*sin(v) / (1+u**2.*(sin(v))**2)
5f892713c3 2021-03-03 38: z(u,v) = a*log(tan(v/2.))+2.*cos(v)/(1+u**2.*(sin(v))**2)
5f892713c3 2021-03-03 39: splot x(u,v), y(u,v), z(u,v) with pm3d
5f892713c3 2021-03-03 40:
5f892713c3 2021-03-03 41:
5f892713c3 2021-03-03 42: reset
5f892713c3 2021-03-03 43: unset surface
5f892713c3 2021-03-03 44: set output "3D Log"
5f892713c3 2021-03-03 45: set title "3D Log"
5f892713c3 2021-03-03 46: set samples 30; set isosamples 30
5f892713c3 2021-03-03 47: set pm3d
5f892713c3 2021-03-03 48: set style line 100 lt 5 lw 0.5
5f892713c3 2021-03-03 49: set pm3d hidden3d 100
5f892713c3 2021-03-03 50: set view 50,220
5f892713c3 2021-03-03 51: set xrange [-2:2]
5f892713c3 2021-03-03 52: set yrange [-2:2]
5f892713c3 2021-03-03 53: splot log(x*x*y*y)
5f892713c3 2021-03-03 54:
5f892713c3 2021-03-03 55:
5f892713c3 2021-03-03 56: reset
5f892713c3 2021-03-03 57: set title "Interlocking Torus"
5f892713c3 2021-03-03 58: set output "3D Torus"
5f892713c3 2021-03-03 59: set parametric
5f892713c3 2021-03-03 60: set urange [-pi:pi]
5f892713c3 2021-03-03 61: set vrange [-pi:pi]
5f892713c3 2021-03-03 62: set isosamples 50,20
5f892713c3 2021-03-03 63: unset key
5f892713c3 2021-03-03 64: unset xtics
5f892713c3 2021-03-03 65: unset ytics
5f892713c3 2021-03-03 66: unset ztics
5f892713c3 2021-03-03 67: set border 0
5f892713c3 2021-03-03 68: set view 60, 30, 1.5, 0.9
5f892713c3 2021-03-03 69: set origin 0.0,-0.1
5f892713c3 2021-03-03 70: set size 0.9, 1.1
5f892713c3 2021-03-03 71: set colorbox vertical user origin 0.9, 0.15 size 0.02, 0.50
5f892713c3 2021-03-03 72: set format cb "%.1f"
5f892713c3 2021-03-03 73: set pm3d depthorder
5f892713c3 2021-03-03 74: splot cos(u)+.5*cos(u)*cos(v),sin(u)+.5*sin(u)*cos(v),.5*sin(v) with pm3d, 1+cos(u)+.5*cos(u)*cos(v),.5*sin(v),sin(u)+.5*sin(u)*cos(v) with pm3d
5f892713c3 2021-03-03 75:
5f892713c3 2021-03-03 76:
5f892713c3 2021-03-03 77: reset
5f892713c3 2021-03-03 78: unset surface
5f892713c3 2021-03-03 79: set output "3D Cosh"
5f892713c3 2021-03-03 80: set title "3D Cosh"
5f892713c3 2021-03-03 81: set samples 30
5f892713c3 2021-03-03 82: set isosamples 30
5f892713c3 2021-03-03 83: set pm3d
5f892713c3 2021-03-03 84: set style line 100 lt 5 lw 0.5
5f892713c3 2021-03-03 85: set pm3d hidden3d 100
5f892713c3 2021-03-03 86: set view 50,220
5f892713c3 2021-03-03 87: set xrange [-2:2]
5f892713c3 2021-03-03 88: set yrange [-2:2]
5f892713c3 2021-03-03 89: splot cosh(x)+cosh(y)
5f892713c3 2021-03-03 90:
5f892713c3 2021-03-03 91:
5f892713c3 2021-03-03 92: reset
5f892713c3 2021-03-03 93: unset surface
5f892713c3 2021-03-03 94: set output "3D Exp"
5f892713c3 2021-03-03 95: set title "3D Exp"
5f892713c3 2021-03-03 96: set samples 30; set isosamples 30
5f892713c3 2021-03-03 97: set xrange [-2:2]
5f892713c3 2021-03-03 98: set yrange [-2:2]
5f892713c3 2021-03-03 99: set pm3d
5f892713c3 2021-03-03 100: splot exp(-x*x)*exp(-y*y)
5f892713c3 2021-03-03 101:
5f892713c3 2021-03-03 102:
5f892713c3 2021-03-03 103: reset
5f892713c3 2021-03-03 104: unset surface
5f892713c3 2021-03-03 105: set output "3D Sin"
5f892713c3 2021-03-03 106: set title "3D Sin"
5f892713c3 2021-03-03 107: set samples 30
5f892713c3 2021-03-03 108: set isosamples 30
5f892713c3 2021-03-03 109: set pm3d
5f892713c3 2021-03-03 110: set style line 100 lt 5 lw 0.5
5f892713c3 2021-03-03 111: set pm3d hidden3d 100
5f892713c3 2021-03-03 112: set view 50,220
5f892713c3 2021-03-03 113: set xrange [-3:3]
5f892713c3 2021-03-03 114: set yrange [-3:3]
5f892713c3 2021-03-03 115: splot sin(x*x+y*y)
5f892713c3 2021-03-03 116:
5f892713c3 2021-03-03 117:
5f892713c3 2021-03-03 118: # PM3D surfaces are not included in the calculation of hidden line removal.
5f892713c3 2021-03-03 119: # However, you can approximate this by drawing the surface twice,
5f892713c3 2021-03-03 120: # once "with pm3d" to produce the surface you want to show, and once
5f892713c3 2021-03-03 121: # "with lines lt -2" to include the same surface in hidden3d calculations.
5f892713c3 2021-03-03 122: # The "lt -2" makes the hidden3d copy of the surface invisible.
5f892713c3 2021-03-03 123: #
5f892713c3 2021-03-03 124: reset
5f892713c3 2021-03-03 125: set hidden3d front
5f892713c3 2021-03-03 126: set isosamples 25,25
5f892713c3 2021-03-03 127: set xyplane at 0
5f892713c3 2021-03-03 128: unset key
5f892713c3 2021-03-03 129: set palette rgbformulae 31,-11,32
5f892713c3 2021-03-03 130: set style fill solid 0.5
5f892713c3 2021-03-03 131: set cbrange [-1:1]
5f892713c3 2021-03-03 132: set title "Mixing pm3d surfaces with hidden-line plots"
5f892713c3 2021-03-03 133: set output "Mixing pm3d surfaces with hidden-line plots"
5f892713c3 2021-03-03 134: f(x,y) = sin(-sqrt((x+5)**2+(y-7)**2)*0.5)
5f892713c3 2021-03-03 135: splot f(x,y) with pm3d, x*x-y*y with lines lt 1 lc rgb "#000000", f(x,y) with lines lt -2 notitle;