"exportgraphics" lengthens the height of EPS

Hi, I am using MATLAB function "exportgraphics" to export some EPS files. I am facing following two problems.
There is an option for "exportgraphics" called "ContentType".
  1. If I set "ContentType" to "vector", then EPS files cannot keep transparency of the figure object I create.
  2. If I set "ContentType" to "image", then somehow EPS files will be lengthened in Y-axis so that the bottom part are missing.
Both above-mentioned problems do not exist for exporting PDF files by using exportgraphics.
Any comment helps!

4 Comments

I tried exporting some random plot to eps format using both "ContentType" property in MATLAB R2023b, but i wasn't able to reproduce the issue.
Can you provide the code/issue screenshot which can be helpful in reproducing the issue?
Thanks for your kind reply. I am writing MATLAB code for a project so it may get people confused if I provided a "local" screenshot.
I think following part of the code may lead to this problem:
fig = figure('visible', 'off');
t = tiledlayout(fig, 1, 1, 'Padding', 'compact', 'TileSpacing', 'compact');
ax = nexttile(t);
I am creating a figure object in this way to get the "tight" figure. No other special operations in my project.
I am trying to convince myself to stop using EPS and use PDF instead.
For the statement: If I set "ContentType" to "vector", then EPS files cannot keep transparency of the figure object I create.
Can you please explain the above statement? Are you applying a background color to the figure that is not appearing in the EPS file?
Not exactly. I am talking about face transparency. See alpha

Sign in to comment.

Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products

Release

R2023b

Asked:

on 16 Jan 2025

Commented:

on 16 Jan 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!