home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1999 February / CT_SW9902.ISO / pc / software / wissen / daten / gnuplot.hqx / gnuplot.2.0b4 / Scripts / demo / surface1.dem < prev    next >
Text File  |  1997-05-03  |  4KB  |  149 lines

  1. #
  2. # $Id: surface1.dem,v 1.5 1995/04/21 12:49:06 drd Exp $
  3. #
  4. set samples 21
  5. set isosample 11
  6. set xlabel "X axis" -3,-2
  7. set ylabel "Y axis" 3,-2
  8. set zlabel "Z axis" -5
  9. set title "3D gnu plot demo"
  10. set label 1 "This is the surface boundary" at -10,-5,150 center
  11. set arrow 1 from -10,-5,120 to -10,0,0 nohead
  12. set arrow 2 from -10,-5,120 to 10,0,0 nohead
  13. set arrow 3 from -10,-5,120 to 0,10,0 nohead
  14. set arrow 4 from -10,-5,120 to 0,-10,0 nohead
  15. set xrange [-10:10]
  16. set yrange [-10:10]
  17. splot x*y
  18. pause -1 "Hit return to continue (1)"
  19. set noarrow
  20. set nolabel
  21. set grid
  22. splot x**2+y**2, x**2-y**2
  23. pause -1 "Hit return to continue (2)"
  24. rep x*y
  25. pause -1 "Hit return to continue (3)"
  26. rep (x**3+y**3)/10
  27. pause -1 "Hit return to continue (4)"
  28. set ticslevel 0.0
  29. set title "3D gnu plot demo ( ticslevel = 0.0 )"
  30. rep
  31. pause -1 "Hit return to continue (5)"
  32. set ticslevel 2.0
  33. set title "3D gnu plot demo ( ticslevel = 2.0 )"
  34. rep
  35. pause -1 "Hit return to continue (6)"
  36. set ticslevel 0.5
  37. set title "3D gnu plot demo ( ticslevel = 0.5 )"
  38. rep
  39. pause -1 "Hit return to continue (7)"
  40. set title "3D gnu plot demo"
  41. set nogrid
  42. splot x*y with points
  43. pause -1 "Hit return to continue (8)"
  44. set noxtics
  45. set noytics
  46. set xrange [-1:1]
  47. set yrange [-1:1]
  48. set title "Surfaces with no grid or tics"
  49. splot x*y with lines, x**2*y**3 with dots, x**3*y*2 with points
  50. pause -1 "Hit return to continue (9)"
  51. set xtics ("low" -3, "mid" 0, "high" 3)
  52. set ytics -2,0.5,2
  53. set xrange [-3:3]
  54. set yrange [-3:3]
  55. set log z
  56. set title "Surfaces with z log scale"
  57. splot x**2*y**2 + 2, x**2*y**4 + 2, x**4*y**2 + 2
  58. pause -1 "Hit return to continue (10)"
  59. set nolog z
  60. set xtics
  61. set ytics
  62. set xrange [-1:1]
  63. set yrange [-1:1]
  64. set samples 51
  65. set isosample 21
  66. set dummy u,v
  67. set title "3D gnu plot demo"
  68. splot u*v / (u**2 + v**2 + 0.1)
  69. pause -1 "Hit return to continue (11)"
  70. splot [x=-3:3] [y=-3:3] sin(x) * cos(y)
  71. pause -1 "Hit return to continue (12)"
  72. set zrange [-0.35:0.35]
  73. replot
  74. pause -1 "Hit return to continue (13)"
  75. set title "Sinc function"
  76. set zrange [-1:1]
  77. set label 1 "This is equal to 1" at -5,-2,0.75 right
  78. set arrow 1 from -5,-2.1,0.75 to 0,0,1
  79. sinc(u,v) = sin(sqrt(u**2+v**2)) / sqrt(u**2+v**2)
  80. splot [-5:5.01] [-5:5.01] sinc(u,v)
  81. pause -1 "Hit return to continue (14)"
  82. set view 70,20,1
  83. set zrange [-0.5:1.0]
  84. set ztics -1,0.25,1
  85. set label 1 "This is equal to 1" at -5,-2,1.5 centre
  86. set arrow 1 from -5,-2.1,1.4 to 0,0,1
  87. splot [-12:12.01] [-12:12.01] sinc(u,v)
  88. pause -1 "Hit return to continue (15)"
  89. set noarrow
  90. set ztics
  91. set nolabel
  92. set log
  93. set auto
  94. set title "This has logarithmic scale"
  95. splot [x=1:15] [y=1:15] x**2+y**2
  96. pause -1 "Hit return to continue (16)"
  97. set nolog
  98. set xrange [0:15]
  99. set yrange [0:15]
  100. set auto
  101. #set zrange [-0.6:0.7]
  102. set ticslevel 0
  103. set data style lines
  104. set title "Data grid plotting"
  105. set parametric
  106. splot "glass.dat"
  107. pause -1 "Hit return to continue (17)"
  108. splot "glass.dat" using 3:2:1
  109. pause -1 "Hit return to continue (18)"
  110. set zrange [-1.2:1.2]
  111. set ticslevel 0.5
  112. set noparametric
  113. splot "glass.dat" using 1, "glass.dat" using 2, "glass.dat" using 3
  114. pause -1 "Hit return to continue (19)"
  115. set param
  116. set title "Test of spherical transform"
  117. set mapp sphe
  118. splot "glass.dat"
  119. pause -1 "Hit return to continue (20)"
  120.  
  121. # mandelbrot demo
  122. set nopar
  123. set mapp cart
  124. set view 60,30,1,1
  125. set auto
  126. set title "" 0,0
  127. set isosamples 60
  128. set hidden3d
  129. compl(a,b)=a*{1,0}+b*{0,1}
  130. mand(z,a,n) = n<=0 || abs(z)>100 ? 1:mand(z*z+a,a,n-1)+1
  131. splot [-2:1][-1.5:1.5] mand({0,0},compl(x,y),30)     
  132. pause -1 "Hit return to continue (21)"
  133. # TANAKA Masaki  (Tokyo Institute of technology)
  134. #                 masaki@isea.is.titech.ac.jp
  135.  
  136. #
  137. # Clean up:
  138. #
  139. set samples 100
  140. set isosamples 10
  141. set xrange [-10:10]
  142. set yrange [-10:10]
  143. set zrange [-10:10]
  144. set auto
  145. set xlabel "" 0,0
  146. set ylabel "" 0,0
  147. set zlabel "" 0,0
  148. set nohidden
  149.