GNUPLOT.red 3.0 KB

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