software:octave:start
Table of Contents
Octave
Installation
To always get the last version, install Octave through Flatpak, from Flathub.
Resize figure
To resize a figure, change its property position
which is a four-element vector of the form:
[x-lower-left-corner y-lower-left-corner width-figure height-figure]
x = (1:10); y = (1:10); plot(x, y); xlim([1 10]); ylim([1 10]); xlabel("x"); ylabel("y"); f = gcf(); pos = get(f, "position"); pos(3:4) = pos(3:4) * .5; set(f, "position", pos); print(["resize-figure"], "-dpdfcrop");
Change axes margin
To change the margins around the axes, vary the last two parameters of the vectors position
.
x = [1:10]; y = x.^2; plot(x, y); xlabel("x"); ylabel("y"); f = gcf(); set(f, "units", "pixels"); pos_figure = get(f, "position") a = gca(); set(a, "units", "pixels"); pos_axes = get(a, "position") pos_axes(3) = pos_figure(3) - pos_axes(1) - 10; pos_axes(4) = pos_figure(4) - pos_axes(2) - 10; set(a, "position", pos_axes);
software/octave/start.txt · Last modified: 2023/05/28 16:37 by 127.0.0.1