Some hints to octave and octave plotting


  • Install Octave and Gnuplot on Snow Leopard: (Instructions from link)

  • After downloading and installing the *.dmg files obtained from SOURCEFORGE, follow the instructions below for a few NECESSARY modifications:
Central storage place for script and function files used with GNU Octave.
 
NOTES FOR SNOW LEOPARD USERS
 
1 - mkoctfile
 
Since OSX 10.6 the Apple shipped version of gcc builds by default 64bit binaries
As the libraries included with Octave.app version 3.2.3 are 32bit, you need to apply
the following patch in order for mkoctfile to work:
 
  1.1) open the folder /Applications in the finder
  1.2) right-click on Octave.app and select "show package contents"
  1.3) navigate to /Applications/Octave.app/Contents/Resources/bin
  1.4) right-click on the file "mkoctfile" and select "Open with -> Other ... -> TextEdit.app"
  1.5) right after the line:
 
     # along with this program; If not, see <http://www.gnu.org/licenses/>.
 
  add the lines
 
     CFLAGS="-m32 ${CFLAGS}"
     FFLAGS="-m32 ${FFLAGS}"
     CPPFLAGS="-m32 ${CPPFLAGS}"
     CXXFLAGS="-m32 ${CXXFLAGS}"
     LDFLAGS="-m32 ${LDFLAGS}"
 
  and save.
 
2 - Gnuplot.app
 
An update to system libraries introduced with OSX 10.6.5 has broken the functionality
of the Gnuplot.app included with the Octave.app distribution, in order to use Gnuplot.app
on  OSX 10.6.5 and later, you can use the fix described below:
 
  2.1) open the folder /Applications in the finder
  2.2) right-click on Gnuplot.app and select "show package contents"
  2.3) navigate to /Applications/Gnuplot.app/Contents/Resources/bin
  2.4) right-click on the file "gnuplot" and select "Open with -> Other ... -> TextEdit.app"
  2.5) change the line:
 
     DYLD_LIBRARY_PATH="${ROOT}/lib:${DYLD_LIBRARY_PATH}"
 
  to
 
     DYLD_LIBRARY_PATH="${ROOT}/lib"
 
  and save.
 
NOTES FOR LEOPARD USERS
 
An update to system libraries introduced with OSX 10.5.8 has broken the functionality
of the Gnuplot.app included with the Octave.app distribution, in order to use Gnuplot.app
on  OSX 10.5.8 and later, you can use the same fix described above for OSX 10.6.5.



  • Printing plots to file with properties for publication. The plot in the figure was generated using the following commands:
plot(x,y,'ko')
        axis([xmin xmax minzplot maxzplot]);
 
        %Build the reference solution for plotting only:
           hold on
        %Horizontal lines:
        line([xmin,xc-R],[zmin,zmin], 'linewidth', 5, 'color', 'k');
        line([xc-R,xc+R],[zmax,zmax], 'linewidth', 5, 'color', 'k');
        line([xc+R,xmax],[zmin,zmin], 'linewidth', 5, 'color', 'k');
        %Vertical lines:
        line([xc-R,xc-R],[zmin,zmax], 'linewidth', 5, 'color', 'k');
        line([xc+R,xc+R],[zmin,zmax], 'linewidth', 5, 'color', 'k');
 
        fs = 24;
        set (gca,'fontsize',fs);
        xlabel ('x - streamline direction', 'FontName','Times','FontSize',fs, 'rotation', 0)
        ylabel ('q', 'FontName','Times','FontSize',fs, 'rotation', 0)
        print ('EPSstreamline.eps','-deps','-S500,400');
 

EPSstreamline.jpg