Search code examples
matlaboctavefltk

Octave plotting with FLTK: Subplots getting smaller and smaller..?


I'm using Octave 3.8.1.

Consider the following code:

I=4;
J=6;
for j=1:J
    for i=1:I
        g=subplot(I,J,(i-1)*J+j);
        imagesc(rand(20,20));
    end
end

This produces the following plot: strangely sized subplots

Why aren't the subplots equally sized? What do I need to do to get them equally sized?

I'm using the default FLTK module for plotting.


Solution

  • I'm writing my comments as an answer for those experiencing similar problems.

    From the ArchLinux documentation: http://wiki.archlinux.org/index.php/Octave - it says FLTK has some serious instability issues. Try changing your default plotting system to gnuplot instead.

    Do this in the command prompt: graphics_toolkit("gnuplot");

    FWIW, I actually reconstructed your figure using FLTK on my end, and this is what I get:

    enter image description here


    So weird!... but the weirdness of FLTK may be platform dependent. I'm on Mac OS, so that may contribute why I'm not getting any weird results.

    Glad to have helped!