Empty pdf if table is saved as pdf
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I am trying save the table t1 by uisng the suggested table-to-figure mathod. However, the saved pdf remains empty.
t1=table(ones(5));
fig = uifigure('Name','Numbers');
t = uitable(fig,'Data',t1);
exportapp(fig,'Peak_assigments.pdf')
0 Commenti
Risposte (2)
Ganapathi Subramanian R
il 7 Giu 2024
Hi Chris,
The following code worked for me in saving the uitable along with its contents as a pdf file.
t1=ones(5);
fig = figure('Name','Numbers');
t = uitable(fig,'Data',t1);
saveas(gcf,'Peak_assignments','pdf')
I hope this helps.
Thanks
0 Commenti
Milan Bansal
il 7 Giu 2024
Hi Chris Pruefert,
I understand that you want to export a table create in MATLAB as a pdf but are facing issues with it.
Instead of using exportapp, you can use the print function and set the format type as "-dpdf". Please refer to the following code snippet for the implementation.
% Sample data for the table
data = {'Apple', 52; 'Banana', 89; 'Cherry', 50};
columnNames = {'Fruthe it', 'Calories'};
% Create the figure
f = figure('Position', [100, 100, 400, 200]);
% Create the table
t = uitable('Parent', f, 'Data', data, 'ColumnName', columnNames, 'Position', [20, 20, 360, 160]);
% Set the figure properties for better output
set(f, 'PaperPositionMode', 'auto');
set(f, 'InvertHardcopy', 'off');
set(f, 'Color', 'w');
% Save the figure as a PDF
print(f, 'table_output', '-dpdf');
Please refer to the following documentation link to learn more about print function.
Hope this helps!
0 Commenti
Vedere anche
Categorie
Scopri di più su Environment and Settings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!