help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printing to file without plot window


From: Vincent Gizzo
Subject: printing to file without plot window
Date: Tue, 28 Jan 2014 13:42:07 -0500

Hello,
 
I created a function that will plot several contour plots and save the images to seperate files. I'm trying to speed this up by just printing the image to the file without the plot windows popping up.
 
I found several referencse to accomplishing this by using figure(1,"visible", "off") before printing the image.
 
http://wiki.octave.org/FAQ#How_do_I_create_a_plot_without_a_window_popping_up_.28ie.2C_a_plot_to_a_file.29.3F
 
However, when I do this the scripts finishes and no files are created. A file with the image is only created when "visable" is set "on". What am I doing wrong?
 
I tried this on both Octave 3.8 (linux) and Octave 3.6.4 (windows w/ cygwin)
 
Here is an example of my code. :
 
 figure(1,"visible","off")
 #linear interpolation
  for i=1:size(preSurface,2)
   #Pre SurfaceContour
   #create string from interger, i to create filenames
   snum=int2str(i);   
   Z=griddata(x,y,preSurface(:,i),X,Y,'linear');
   h=surf(X,Y,Z,'EdgeColor','none');
     
   #formatting for plot
   view (2);
   colorbar("EastOutside",'fontsize',12,"fontweight","bold");
   axis equal;
   grid off;
   # concatenate slot number and name for text file name
   slot=[snum,"_preSurface"];
   print ("h",slot,"-dpng");
   limit=caxis();

reply via email to

[Prev in Thread] Current Thread [Next in Thread]