Plot titles not centered when plot is exported as pdf in Linux version only
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Running Matlab in Linux (Mint 21.1 Cinnamon). I make a plot, I resize it on the screen, then I export it as a pdf using
exportgraphics(h,'test1_v7.pdf','ContentType','vector');
The title(s) above each plot are off-center in the pdf file. Always. 100% of the time. But they are perfect on the screen. Here's an example:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1437338/image.png)
But it works fine in Matlab running in Windows 10.
I though it was related to OpenGL so I ran this line before plotting. Made no difference whatsoever.
set(0,'DefaultFigureRendererMode','manual')
The probem also occurs when exporting to eps format. It does not occur when exporting to png, tiff, or jpg. This leads me to believe it's related to vectorization. I would like to try it with svg, but the exportgraphics command cannot handle svg.
Any suggestions would be appreciated.
Edit: this problem extends to axis labels and legend entries also.
Note the whitespace padding in the x-axis label in image below. MATLAB figure on bottom, pdf export on top. Happens only in Linux version of MATLAB, pdf and eps exports only. Not in Windows version or in png, jpg, or tiff files.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1438063/image.png)
Similar problem happens with legend entries. Upper legend is MATLAB figure, bottom is pdf export. Note erroneous whitespace padding in the pdf export. Happens only in Linux version of MATLAB, pdf and eps exports only. Not in Windows version or in png, jpg, or tiff files.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1438068/image.png)
0 Kommentare
Antworten (1)
Angelo Yeo
am 19 Jul. 2023
If this is reproducible, it may be a bug. You can reach out to MathWorks Technical Support with reproduction steps.
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!