help-octave
[Top][All Lists]
Advanced

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

Plotting to files and to mat-files with different Octave Versions for MS


From: Stefan Pofahl
Subject: Plotting to files and to mat-files with different Octave Versions for MS-Windows
Date: Mon, 23 Apr 2012 19:32:58 +0200

Hello dear all,

first of all a big thank-you to of you that contribute to the development of Octave.
Here my experiance with the Octave-Versions: 3.4.3, 3.6.0 and 3.6.1
MAT-files:
vers. 3.4.3 is the best for building large (more than 30.000.000 elements) mat-files.
My advice for Octave v3.4.3 try the plain mat-file-version, if you run in troubles, e.g. "-mat" instead of "-v7".
Do not use v3.6.0 or v3.6.1 with large arrays, the resulting ".mat" are much to small.

Plotting:
With version 3.4.3 and 3.6.1 I have problems to use the commands "saveas" and "print",
v3.6.0 for windows is much better on my machine (MS Windows 7) and do not install Octave in
folders with spaces in the name (ok, it is written every where), e.g.: "c:\bin\octave" instead
of "c:\Program Files\Octave".

If you installed several Octave versions and you want to compare the "plot-to-files" properties
you may adapt the code below to your needs.

Regards,

Stefan

---

function [ ret ] = check_plot_formats ()
  ret = 0;
  %% --
  temp_dir = 'c:\temp';
  plt_dir = 'c:\temp\octave_plt\';
  %% --
  mkdir(temp_dir);
  mkdir(plt_dir);
  v=ver('Octave');
  %% --- Ploting ---------------------------------------------------------------
  x = [1:0.1:3.4]';
  h_plt = plot(sin(x));
  %% --- FLTK graphic engine ---------------------------------------------------
  if (str2num(v.Version([1 3 5])) < 360)
    disp('below vers 360')
    __init_fltk__;
    version_s = 'fltk';
  else
    graphics_toolkit ('fltk');
    version_s = graphics_toolkit ();
  end
  refresh;
  octver_graphtool = [v.Name, v.Version, '_', version_s];
  disp(['Octave version Graph toolkit: ', octver_graphtool]);
  print([plt_dir, octver_graphtool, '.jpg'], '-djpg');
  print([plt_dir, octver_graphtool, '.png'], '-dpng');
  print([plt_dir, octver_graphtool, '.emf'], '-demf');
  print([plt_dir, octver_graphtool, '.jpg'], '-djpg');
  print([plt_dir, octver_graphtool, '.pdf'], '-dpdf');
 
 %% -- saveas function --------------------------------------------------------
  if (str2num(v.Version([1 3 5])) < 360)
    __init_fltk__;
    version_s = 'fltk';
  else
    graphics_toolkit ('fltk');
    version_s = graphics_toolkit ();
  end
  octver_graphtool = [v.Name, v.Version, '_', version_s];
  disp(['Octave version Graph toolkit: ', octver_graphtool]);
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.pdf'], 'eps');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.ps'], 'ps');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.jpg'], 'jpg');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.png'], 'png');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.pdf'], 'pdf');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.emf'], 'emf');
 
  %% --- gnuplot graphic engine ------------------------------------------------
  if (str2num(v.Version([1 3 5])) < 360)
    graphics_toolkit ("gnuplot");
    version_s = 'gnuplot';
  else
    graphics_toolkit ('gnuplot');
    version_s = graphics_toolkit ();
  end
  refresh;
  octver_graphtool = [v.Name, v.Version, '_', version_s];
  disp(['Octave version Graph toolkit: ', octver_graphtool]);
  print([plt_dir, octver_graphtool, '.jpg'], '-djpg');
  print([plt_dir, octver_graphtool, '.png'], '-dpng');
  print([plt_dir, octver_graphtool, '.emf'], '-demf');
  print([plt_dir, octver_graphtool, '.jpg'], '-djpg');
  print([plt_dir, octver_graphtool, '.pdf'], '-dpdf');
 %% -- saveas function --------------------------------------------------------
  if (str2num(v.Version([1 3 5])) < 360)
    graphics_toolkit ("gnuplot");
    version_s = 'gnuplot';
  else
    graphics_toolkit ('gnuplot');
    version_s = graphics_toolkit ();
  end
  octver_graphtool = [v.Name, v.Version, '_', version_s];
  disp(['Octave version Graph toolkit: ', octver_graphtool]);
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.pdf'], 'eps');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.ps'], 'ps');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.jpg'], 'jpg');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.png'], 'png');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.pdf'], 'pdf');
  saveas(h_plt, [plt_dir, octver_graphtool, '_saveas.emf'], 'emf');
 
end  %% end: function


--
Stefan Pofahl c/o Y. de Vasconcelos
Rue des Moulins 125B
1400 Yverdon-les-bains


reply via email to

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