Skip to content
Advertisement

Tag: matlab-figure

Is there a MatLab equivalent of Python matplotlib’s tight_layout()?

I find the amount of whitespace around plots in both normal Python Matplotlib and Matlab quite annoying, specifically the left and right margins that make your plot look tiny when inserting the saved (landscape) figure into a standard (portrait) .doc or .pdf file. Fortunately Python Matplotlib has the “tight_layout()” functionality that takes care of this beautifully. Does Matlab have a

Matlab equivalent to Python’s figsize

In Python’s matplotlib.pyplot the figsize command allows you to determine the figure size, eg. Is there an equivalent command in Matlab that does this? These old posts show different solutions but none are as clean as Python’s figsize. Answer Since you aim for saving/exporting your figure, you must pay attention to the right Figure Properties, namely: PaperPosition, PaperSize, and PaperUnits.

Advertisement