3

I have to use these graphs for a powerpoint presentation and I wanted to know how I could spruce it up to make it look more presentable and inviting. I can't even change the fontsize. Anything that can make the graph look more inviting will get the thumbs up as the 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)');

Thanks.

PythonNoob
  • 39
  • 5

2 Answers2

2

Here's a few things that I find myself doing every time I need a plot to look presentable.

  1. Change the fontsize to 14.

    set(gca,'fontsize',14);

  2. Make linewidth larger and/or markersize larger

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

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

  3. Sometimes turn grid on

    grid on

To put it all 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');
rayryeng
  • 102,964
  • 22
  • 184
  • 193
Trogdor
  • 1,346
  • 9
  • 16
  • Answer from @Trogdor is perfect. I would probably add to it the [matlab2tikz ](http://www.mathworks.com/matlabcentral/fileexchange/22022-matlab2tikz ) which will enhance the plot quality, the fonts, as well as remove the the white space around – user2536125 Aug 13 '14 at 06:19
1

Most importantly - change to the still undocumented and yet not officially supported HG2-Graphics-Engine. The improvements you get are better than anything else you could achieve with the "old" functionality.

It already works really nice, I'm not seeing a lot of bugs. There are issues, but they are solvable.

Apart from that, you could use nicer fonts, especially if you want to use the plots in combination with Latex. You can set it globally, as well as the fontsize:

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

Also use the Latex-Interpreter for your labels:

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

With some easy steps, you get much better results. Mostly apparent for plots with logarithmic scale: enter image description here

Community
  • 1
  • 1
Robert Seifert
  • 25,078
  • 11
  • 68
  • 113