Octave/Sombrero
3-D Sombrero Plot[edit]
octave:2> tx = ty = linspace (-8, 8, 41);
octave:3> [xx, yy] = meshgrid (tx, ty);
octave:4> r = sqrt (xx .^ 2 + yy .^ 2) + eps;
octave:5> tz = sin (r) ./ r;
octave:6> mesh (tx, ty, tz);
octave:7> xlabel ("tx");
octave:8> ylabel ("ty");
octave:9> zlabel ("tz");
octave:10> title ("3-D Sombrero Plot");
We can now print the plot to a file with:
octave:11> print -dpng sombrero.png
It may take a few seconds to produce the file; be patient.
It's necessary to adjust the file's permissions to enable web server access. This may easily be performed from within octave using the following command:
octave:12> system("chmod -R a+rX ~/www")
When the prompt returns, the file may be viewed in a browser. Every user has a personal URL. Your file may be viewed here: You must be logged in to view your personal URL.