Improving Presentation of a Graph
Show older comments
I have produced a graph running some simulations which I would like to use in Powerpoints and whose presentation and professionalism I would like to improve.

There are few things I would like to change. Something is wrong with the resolution of the graph and the grid lines: I think this is due to the fact that I have printed and saved the graph as PNG image file: is there another type of file which I should save it as so the resolution and clarity is improved?
Secondly, the F_d/F_s on the y-axis needs to be in Maths font. Also, it seems like the analytic solutions I have plotted (corresponding to the coloured lines) have been drawn in a piecewise continuous way which interpolates in between the dots on the red curve, these dots correspond to the result from a numerical method. When you look at the graph you can see the curves are connected in a piecewise continuous way when they should just be smooth curves. Is there some way of fixing this? I can reproduce the relevant part of the code if necessary or can include more of the code if necessary.
figure
plot(KnA, expA, 'b')
hold
plot(KnA, slipS,'g')
fsz = 10; % Fontsize
alw = 1.5; % LineWidth
msz =10; % MarkerSize
plot(KnA,gradS,'.','MarkerSize',msz,'MarkerFaceColor','blue')
plot(KnA,G13An,'r')
grid on
box on
set(gca, 'FontSize', fsz, 'LineWidth', alw);
legend('Millikan exp. data' ,'Analytic-Basset','MFS-G13', 'Analytic-G13', 'Location', 'NorthEast');
xlabel('Kn')
ylabel('F_{d} / F_{s}')
print('Youngincl','-dpng','-r300');
10 Comments
dpb
on 13 Jul 2019
plot() draws lines between plotted data points -- if you want more resolution you need to either
- compute more intermediate points to plot, or
- use an interpolation scheme (interp1 is one easy way)
to smooth out the drawn curve.
You can use fontname{specifier} with the TeX interpreter...the success of this wlll be dependent upon installed fonts on your system.
One of the "unprofessional" things that bugs me no end that TMW never gets around to fixing is the inconsistent number format on the axis tick labels...try
hAx=gca; % get handle to axes object
hAx.YAxis.TickLabelFormat='%0.1f'
I'll let others comment on the better format to save for import to PowerPoint or other apps except that something other than just a bit image is undoubtedly better choice.
Hollis Williams
on 13 Jul 2019
Edited: Hollis Williams
on 13 Jul 2019
There's only one (smallish) difference with the line of code --the yaxis tick "1" will be rendered as "1.0" consistent with all the rest that are one decimal place.
ML uses TeX interpreter by default for labels...
hAx=axes; % make axes, return handle
hAx.YAxis.TickLabelFormat='%0.1f'; % observe what the tick labels are on x compared to y after
hAx.YAxis.TickLabelInterpreter % display default interpreter
ans =
'tex'
In
set(gca, 'FontSize', fsz, 'FontName', Maths, 'LineWidth', alw);
Maths will be interpreted as a variable, you need an installed font name in text in that position. What is installed on your system is, obviously, system dependent..you can look at the control panel font tools to see what you have available to you--there's nothing like 'Maths' on the system here; I'm pretty weak in that area of customization so have no idea if that's some known name or not.
As far as the question on interpolation -- it's your call what you choose to display -- as noted plot() just draws a straight line between the input points it is given--you talk about having analytical solutions -- to refine the plot you have the basic choice of either running that solution at sufficient points until you're satisfied with the appearance of the curves or, using an interpolation function to fill in the intermediate values. Those appear to be quite smooth functions so a spline or similar would be expected to be almost indistinguishable from the solution, but of course, only testing will show how good/bad it is.
It's pretty-much trivial to use, something like
xhat=linspace(kna(1),kna(end)); % get 100 points between first, last
Shat=interp1(kna,slipS,xhat,'spline'); % use spline interpolant between
plot(KnA, slipS,'g.') % put points on the graph w/o line
hold on
plot(xhat,Shat,'g-') % add the interpolated line
Similar for other analytic values; I'd guess you might not want to draw a line at all between the purely experimental points -- that is somewhat presumptious for experimental data -- or a very light dashed one if at all for some visual clue as it, too, does seem pretty smooth so isn't too egregious of an assumption it would appear.
Hollis Williams
on 13 Jul 2019
dpb
on 13 Jul 2019
All your choice... :)
Hollis Williams
on 13 Jul 2019
dpb
on 13 Jul 2019
Not system fonts, no...altho I presume the list in the PREFERENCES menu for setting fonts for ML command window, etc., etc., are populated from the system list, I was specifically thinking of the Windows control panel.
AFAIK, there's no interactive setting there for those used in graphics, those are all set by startup options and system defaults as described at https://www.mathworks.com/help/matlab/creating_plots/default-property-values.html
I presume the following is factory; I don't recall ever changing...
>> get(groot,'factoryaxesfontname')
ans =
'Helvetica'
>>
Hollis Williams
on 14 Jul 2019
I'm certainly no whizard, no...when I did thesis and writing for publication we were still typing w/ IBM Selectrics on publication mats... :)
Best I know personally is to direct you to the documentation link https://www.mathworks.com/help/matlab/printing-and-exporting.html
and browse from there. I do know that the File/SaveAs menu item and the function saveas both are limited in resolution and size, etc., ... while print has more options available that is probably where you need to be.
But, I've never had to deal with trying to actually publish any MATLAB work in serious journals; all my work has been as consultant to individual clients who really didn't care about format; "just the facts, Ma'am!", so I've no practical experience.
Hollis Williams
on 18 Jul 2019
Accepted Answer
More Answers (2)
Yair Altman
on 22 Jul 2019
0 votes
Regarding output quality, esp. for EPS that you mentioned - many people found the export_fig utility useful for preparing publication-quality export of Matlab figures/charts. Under the hood export_fig uses the built-in print() function, but it makes numerous small tweaks to the inputs (figure/chart properties, and print() parameters) and output (post-processing of the EPS file) that improve the resulting output file.
atharva aalok
on 17 Oct 2021
0 votes
Please refer the following Plotting Template:
The above is an easy to follow Beginner Friendly template.
The idea is to create Professional Standard Plots within seconds without a steep learning curve and with consistency.
It also offers a wide range of preset Color Codes (please refer the attached image for the Color Palatte)
Sample Plot:

Color Palatte:

Categories
Find more on Graphics Performance 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!