How to make Matlab graphs look better

I need to use these graphs for my PowerPoint presentation and would like to know how I could use it to make it more presentable and attractive. I can't even change the font. Anything that can make the graph look more attractive will get thumbs up as an answer. This is done in Matlab, by the way.

a = load('2small1big_heating');
m = load('2small1big_cooling');
xdata = m(:,5)
ydata = m(:,4)
pPoly = polyfit(xdata, ydata, 1); % Linear fit of xdata vs ydata 
 linePointsX = [min(xdata) max(xdata)]; % find left and right x values 
 linePointsY = polyval(pPoly,[min(xdata),max(xdata)]); % find y valuesfigure(1)

plot(m(:,5),m(:,4)/6269,'bo')
hold on
plot(a(:,5),a(:,4)/6269,'ro')

title('2Small1Big- Heating and Cooling')
legend('Cooling','Heating')
ylabel('Potential Energy (eV)');
xlabel('Temperature (K)');

      

Thank.

+3


source to share


2 answers


Here are a few things I find myself every time I need a plot to look presentable.

  • Change the font to 14.

    set(gca,'fontsize',14);

  • Make the line width wider and / or increase the size of the marker

    plot(x,y,'r','linewidth',2);

    plot(x,2*y,'b.','Markersize',18);

  • Sometimes turn on the grid on

    grid on



Together

x = 1:20;
y = rand(1,20).*x;

figure; hold on;
set(gca,'fontsize',14);
a = plot(x,y,'r','linewidth',2);
plot(x,2*y,'b.','Markersize',18);
grid on
xlabel('X (x units)');
ylabel('Important Stuff');
title('VERY IMPORTANT PLOT');

      

+2


source


The most important thing is to switch to the previously undocumented and not yet officially supported HG2-Graphics-Engine . The improvements you get are better than anything else you could achieve with the "old" functionality.

This already works very well, I don't see many errors. There are problems , but they are solvable.

Plus, you can use nicer fonts, especially if you want to use graphics in combination with latex. You can install it globally as well fontsize

:

set(0,'defaultAxesFontName', 'CMU Serif Roman')
set(0,'defaultAxesFontSize', 12)

      



Also use Latex -Interpreter for your labels:

y_label = {'$$ \mathrm{Mag} ( G ) \rm ~in~ dB$$','interpreter','latex';
x_label = {'$$ f \rm ~in~ Hz$$','interpreter','latex'};

      

With a few simple steps, you will get much better results. Mainly for sections with a logarithmic scale: enter image description here

+1


source







All Articles