kill(all)$

van=facebook.com/LearningCalculus$

      Show the six linecolors in the order r, g, b, c, m  b

lineThickness: 3$

sixLineStyles: [style,
                  [lines,lineThickness,5],
                  [lines,lineThickness,2],
                  [lines,lineThickness,3],
                  [lines,lineThickness,1],
                  [lines,lineThickness,6],
                  [lines,lineThickness,4]
               ]$

plot2d(
[ [discrete,[[0,0],[0,5]]],
          [discrete,[[2,0],[2,5]]],
          [discrete,[[4,0],[4,5]]],
          [discrete,[[6,0],[6,5]]],
          [discrete,[[8,0],[8,5]]],
          [discrete,[[10,0],[10,5]]],
          [discrete,[[12,0],[12,5]]],
          [discrete,[[14,0],[14,5]]] ],
          sixLineStyles,
          [x,-2,20],
          [y,-2, 8],
          [legend,"0","1","2","3","4","5","6","7"],
          [xlabel," "],
          [ylabel," "],
          [box,false],
          [axes,false])$

      Plot to a clean postscript file on the desktop.

plot2d(
          sin(x), 
          [x, 0, 2*%pi],
          [gnuplot_term, ps],
          [gnuplot_out_file, "/Users/van/Desktop/friggle.eps"]
      )$

plot2d(     [gamma(x), 1/gamma(x)],
            [x, -20.1, 20.], [y, -50, 50],
            sixLineStyles,
            [gnuplot_preamble, "set key bottom"]
      )$

expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y) + 3.0) - 10.0$
expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y) + 3.0)$
expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))$
plot3d ([expr_1, expr_2, expr_3], [x, -%pi, %pi], [y, -%pi, %pi], ['grid, 40, 40]);

 plot3d(    r^.33*cos(th/3),
            [r, 0, 1],
            [th, 0, 6*%pi],
            ['grid, 12, 80],
            ['transform_xy, polar_to_xy],
            [gnuplot_term, ps],
            [gnuplot_out_file, "/Users/van/Desktop/friggle.eps"]
       );

expr_1: cos(y)*(10.0+6*cos(x))$
expr_2: sin(y)*(10.0+6*cos(x))$
expr_3: -6*sin(x)$
plot3d( [expr_1, expr_2, expr_3],
        [x, 0, 2*%pi],
        [y, 0, 2*%pi],
        ['grid, 40, 40]
);

plot3d(    2^(x^2 - y^2),
          [x, -1, 1],
          [y, -2, 2]
      );