How can I export my figures to .pdf without them changing style?

11 views (last 30 days)
I need to export 80 figures (each contains a uitable and plot) to a single pdf document. I was able to do this when my figure only contained the plot, but now that I've added a uitable next to it (I've also tried adding it under the plot), it cuts off half the table and half the plot on my pdf. I've tried different print methods such as 'bestfit' etc, yet it never works.
I can export each figure as JPEG and it looks the way I want it to, but I obviously don't want the to save every 80 image by hand to JPEG as well as then later trying to combine those JPEGs into a pdf file.
Any suggestions? I'm fairly new to matlab so I don't knmow all the terminology very well.
Each figure is created after a for loop. Once a single figure is completed (table + plot) , before my for loop ends there is a : print ('-fillpage', '-dpsc2',['DraftDoc' ], '-append', '-f'); %gcf or -bestfit
  1 Comment
Ulises Alejandro Aregueta Robles
Ulises Alejandro Aregueta Robles on 29 Sep 2025 at 1:49
I have worked around this issue by:
  • Making sure the figure position matches the size of the Word document where I want to paste it, and
  • Exporting the figure using exportgraphics:
>> ax=gca;
>> exportgraphics(ax,"Figure_Name.png")

Sign in to comment.

Answers (0)

Categories

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

Community Treasure Hunt

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

Start Hunting!