Problem Saving Figures (Scaling Issues)

Using plot() or subplot(), my figures always save… disfigured. They look scrunched up. Here’s an example, on my screen the figure looks fine, without overlapping, but when saved I’ll get:

(You can tell mostly in the legend. For subplot(), the problems are generally far worse.)

I’ve tried saving in several formats (.jpg, .pdf, .eps)

I’ve tried setting the default figure size larger in .octaverc.

Out of curiosity, are manual changes, including figure re-sizing, supposed to be saved with the figure? Or will it only save the original output? (That is, saving from the figure output pane, not saving programmatically.)

I’ve also tried setting paperpositionmode explicitly to manual.

I am new to Octave, so I apologize if it’s a newbie error, and I appreciate any help.

  • OS: Windows 10 (Education) (Work laptop)
  • Octave version: 5.2.0 (okay, okay, I’ll try this first.), downloaded .exe

Brief snippet of how I used plot():

figure('Position',[100 100 1400 500]);
set(gcf, 'PaperPositionMode', 'manual');
plot(t,DispTrans, t, Disp, t, SteadyState)
xlabel('time (s)')
ylabel('displacement (m)')
legend('Transient Response','Displacement',...
'Steady State Amplitude','Location','southeast')
set(gca,'FontSize',14);

The issue with the legend not being resized when printing (or manually resizing the figure window) should be solved in Octave 6. As for the issue with subplots, I don’t know.

1 Like

I just had 6 installed. (Can’t do it myself as it’s a work laptop.)

That did fix the legend overlapping, and the scaling issue is definitely lessened, but still some scaling. Here’s a comparison: (Top is the saved .jpg, and bottom is the actual figure output. Didn’t experiment with pdf or eps output.)

I’d consider that amount of rescaling “usable” whereas beforehand it wasn’t. Thanks for your help!

Yeah, unfortunately the font size is smaller for onscreen rendering than for printing, hence the difference.
See e.g. this bug report.

If you are using the same font size for all the test objects, you can adjust the fontsize duting the printing.
E.g. I use fontsize 12 for onscreen plots, but then use 9 for prints:

octave:1> plot(1:10)
octave:2> title("1234567890 this is just a test 1234567890", "fontsize", 12)
octave:3> print("t1.png", "-F:9")

Still not ideal, but pretty close.

Thank you both for the help.