home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / GNUPDEMO.ZIP / polar.demo < prev    next >
Text File  |  1992-03-25  |  1KB  |  54 lines

  1. #
  2. # $Id: polar.demo,v 3.26 92/03/24 22:32:23 woo Exp Locker: woo $
  3. #
  4. #
  5. # Show some of the new polar capabilities.
  6. #
  7. set polar
  8. set dummy x
  9. set samples 160
  10. set xrange [0:2*pi]
  11. set title "Three circles (with aspect ratio distortion)"
  12. plot .5,1,1.5
  13. pause -1 "Hit return to continue"
  14. set title ""
  15.  
  16. plot cos(2*x)
  17. pause -1 "Hit return to continue"
  18.  
  19. plot 2*sqrt(cos(x)),-2*sqrt(cos(x))
  20. pause -1 "Hit return to continue"
  21.  
  22. set offset pi/4,pi/4,0,0
  23. plot sin(4*x),cos(4*x)
  24. set offset 0,0,0,0
  25. pause -1 "Hit return to continue"
  26.  
  27. set yrange [-5:5]
  28. plot x/cos(3*x)
  29. pause -1 "Hit return to continue"
  30. set autoscale
  31.  
  32. plot 1-sin(x)
  33. pause -1 "Hit return to continue"
  34.  
  35. set xrange [0:12*pi]
  36. plot 2*x
  37. pause -1 "Hit return to continue"
  38.  
  39. butterfly(x)=exp(cos(x))-2*cos(4*x)+sin(x/12)**5
  40. set samples 800
  41. pause 0 "This is a big one (many samples), be patient..."
  42. set title "Butterfly"
  43. set nokey
  44. plot butterfly(x)
  45. pause -1 "Hit return to continue"
  46.  
  47. # undo what we've done above
  48. set nopolar
  49. set samples 160
  50. set autoscale xy
  51. set title ""
  52. set offset 0,0,0,0
  53. set key
  54.