Greetings...

You might also be interested in my research website as well...

Thursday, May 3, 2012

Subplot spacing in Octave 3.2.3

Figured out how to fix the terrible spacing troubles with subplots in Octave 3.2.3.  They were coming out overlapped and squished on top of each other, clearly a bug, but on machines that I didn't have Matlab on I'd just have to manually fix it up each time by adding in a bunch of set(h,'position'... statements in the scripts, which would then need to be manually fudged and updated if anything else changed.  Bleah.


This was fixed for Octave 3.4.0 but that version is not out in easily updatable binaries for all OS distributions yet and I was stuck with Octave 3.2.3.  But I finally found it's an easy fix - no recompiling or anything, just a one-line tweak in an m-file.  (You'll notice this file is on my Mac but it's a problem on all platforms, and you can find this same file in its respective folder on other OS's too...)

In the file 
/Applications/Octave.app/Contents/Resources/share/octave/3.2.3/m/plot/__go_draw_axes__.m, 
replace line 50 (after making a backup copy of the file):
 ## pos = pos - implicit_margin([1, 2, 1, 2]).*[1, 1, -0.5, -0.5];
with:
 pos(1:2) = pos(1:2) - implicit_margin .* [0.75, 0.5];

And that's it.  Note this is based on Ben Abbot's fix for Octave v3.4.0 at  https://savannah.gnu.org/bugs/index.php?29656

Hm, however the problem seems to remain for image and imagesc though, those must be in a separate call...

No comments:

Post a Comment