2

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.

theV0ID
  • 4,172
  • 9
  • 35
  • 56
  • Woah... that is so weird. That shouldn't be happening at all. I tried reconstructing on my end. I'm on Octave 3.8.1 and this is what I get with your code: http://i.stack.imgur.com/0DjzQ.png . Try using `imshow` perhaps? – rayryeng Dec 03 '14 at 20:11
  • Tried `imshow`, same results, problem remains (except for the plots are not colored of course) – theV0ID Dec 03 '14 at 20:16
  • 2
    From the ArchLinux documentation: https://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");` – rayryeng Dec 03 '14 at 20:21
  • The problem is, gnuplot has other issues. But in case this is a bug, I will stick to it for the moment. Thanks. – theV0ID Dec 03 '14 at 20:26
  • You may have to switch back and forth depending on what you want to show. Did switching the graphics system work? Also, mind if I write an answer? – rayryeng Dec 03 '14 at 20:27
  • Yes, it solved *this* isse ;) Sure, write one, I will accept it. – theV0ID Dec 03 '14 at 20:31
  • Are you using Windows 7? – user3353819 Dec 07 '14 at 20:29
  • @user3353819 No, Linux, Ubuntu 12.04 to be precisely. – theV0ID Dec 08 '14 at 21:57
  • @theV0ID Ah nm. I was wondering if it might have been related to this: https://groups.google.com/forum/#!topic/fltkgeneral/_QUBkFsbQnQ which is to do with a bug regarding miscalculating window borders which has the side effect of windows appearing too small. Probably unrelated. – user3353819 Dec 08 '14 at 23:25

1 Answers1

2

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!

rayryeng
  • 102,964
  • 22
  • 184
  • 193