user2691544
user2691544

Reputation: 359

smoothing graph line in Matlab

I have the following graph and i would like to make it more pleasing to the eyes by smoothing the graph. is it possible ?

enter image description here

tempyr = 1880:1:2014;  
temperature = temp(1:2, 1:135);
Tempval = {'Annual Mean','5 Year Mean'}
TH = zeros(size(Tempval));
hold on
TH = plot( tempyr', temperature', '-o', 'Marker', '.');
xlabel( 'year', 'fontsize', 24); ylabel( 'Temperature Anomaly (Degree Cel)', 'fontsize', 24 );
legend(TH, Tempval)
grid on

Ideal graph. enter image description here

Upvotes: 1

Views: 956

Answers (1)

Mathias
Mathias

Reputation: 1500

Try

TH = plot( tempyr', temperature', '-o', 'Marker', '.','LineSmoothing','on');

and also have a look here, especially the export_fig reference might prove useful.

Upvotes: 1

Related Questions