HoloDraw Home | Documentation | Download | Examples | Frequently Asked Questions (FAQ)

Surface plot of a function

Surface plot of a function
This image is also available as: 600x450/sph.gif | 600x450/sph.jpg | 600x450/sph.png | 900x675/sph.gif | 900x675/sph.jpg | 900x675/sph.png | sph.iv | sph.wrl | thumb/sph.png

Script

Here's the Unix shell script that created this image:
(If you are using another operating system, and it does not have a sufficiently powerful scripting language, you may have to do some of these operations manually.)

#!/bin/sh
# filename:  sph.sh
# author:    Marvin Simkin
# date:      2004-03-15
# purpose:   Draw a 3D graph of a "Sales per Hour" compensation plan

# make tickmarks and annotations along the W and I lines
echo 'color=1 1 1; fontjust=RIGHT; fontheight=165; point:0 0 1,99 20000 1999' |
  drawbbox.pl -B20+8/5000+1600/400WI |
  # but we don't want the axis lines
  grep -v axis > sphbox.draw

# make tickmarks and annotations along the S and J lines
echo 'color=1 1 1; fontjust=LEFT; fontheight=165; point:0 0 1,99 20000 1999' |
  drawbbox.pl -B20+8/5000+1600/400SJ |
  # but we don't want the axis lines
  grep -v axis >> sphbox.draw

# the grid in front of the black backstop
echo 'color=1 1 0;point: 1 20000 1, 100 20000 1999' |
  drawbbox.pl -B10-100/0+0/100-2000im |
  # but we don't want the axis lines
  grep -v axis >> sphbox.draw

echo 'color=1 1 0;point: 100 1 1, 100 20000 1999' |
  drawbbox.pl -B0+0/2500-20000/100-2000dj |
  # but we don't want the axis lines
  grep -v axis >> sphbox.draw

cat sph.draw sphbox.draw |
  drawsize.pl 2 0.01 0.09 |
  drawwrl.pl > sph.wrl

cat sph.draw sphbox.draw |
  drawsize.pl 2 0.01 0.09 |
  drawiv.pl > sph.iv

HoloDraw input file

Here's the HoloDraw input file that created this image:
(See the HoloDraw syntax documentation for details about what these keywords and values mean.)

# filename:  sph.draw
# author:    Marvin Simkin
# date:      2004-03-15
# purpose:   payroll plan analysis

# paid 9.45 per hour for first 40 hours
color = 1.0 0.6 0.0 # orange
polygon: 0 0 0, 40 0 0, 40 0 378
polygon: 0 0 0, 40 0 378, 40 5600 378
polygon: 0 0 0, 40 5600 0, 40 0 0

# paid time and a half after 40 hours
color = 1.0 0.0 0.0 # red
polygon: 40 0 0, 100 0 0, 100 0 1228.5, 40 0 378
polygon: 40 0 378, 100 0 1228.5, 100 14000 1228.5, 40 5600 378
polygon: 100 0 0, 100 0 1228.5, 100 14000 1228.5, 100 14000 0
polygon: 40 0 0, 100 0 0, 100 14000 0, 40 5600 0

# commission plan 0.0675 of sales
color = 0.0 1.0 0.0 # green
polygon: 0 0 0, 40 5600 378, 40 20000 1350, 0 20000 1350
polygon: 0 0 0, 0 20000 1350, 0 20000 0
polygon: 0 20000 0, 40 20000 0, 40 20000 1350, 0 20000 1350
polygon: 0 0 0, 40 5600 0, 40 20000 0, 0 20000 0

# commission plan plus overtime
color = 0.0 0.0 1.0 # blue
polygon: 40 5600 378, 100 14000 1228.5, 100 20000 1633.5, 40 20000 1350
polygon: 100 14000 1228.5, 100 14000 0, 100 20000 0, 100 20000 1633.5
polygon: 100 20000 1633.5, 100 20000 0, 40 20000 0, 40 20000 1350
polygon: 40 5600 0, 100 14000 0, 100 20000 0, 40 20000 0

# backstop
color = 0 0 0 # black
polygon: 0 20015 0, 101 20015 0, 101 20015 2000, 0 20015 2000
polygon: 101 0 0, 101 0 2000, 101 20015 2000, 101 20015 0

# some invisible points to help things center properly
color = 0 0 0 # black
point: -10 -2000 -200, 110 -2000 -200
point: -10 22000 -200, 110 22000 -200
point: -10 -2000 2200, 110 -2000 2200
point: -10 22000 2200, 110 22000 2200

# captions
color=0.0 0.8 1.0
fontheight=165
fontjust=LEFT
text2:100 -4800 1000,Total Pay
fontjust=RIGHT
text2:-10 20000 1000,Total Pay
fontjust=CENTER
text2:-30 10000 -200,Sales
text2:50 -6000 -200,Hours Worked


Written by Marvin Simkin
Filename sph.html
Last updated January 10, 2005
Arizona State University Valid HTML 4.01!
Freedom to Choose ANY Browser