1

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

Sadegh
  • 865
  • 1
  • 23
  • 47
user2691544
  • 359
  • 1
  • 4
  • 11
  • Which graph would you like to smooth? The annual mean? The 5-year mean? Can you provide an example of how you envision the result of such smoothing? How would you address the loss of data? – Schorsch Apr 23 '14 at 14:25
  • How is the *ideal* graph different from the graph you produce? – Schorsch Apr 23 '14 at 14:41
  • Do you maybe want the lines not to have stairs? Like antialiasing? – Mathias Apr 23 '14 at 14:50
  • @Mathias yeap. I would like to remove the sharp drop or increase in height. (stairs) would that be possible ? Also how do i incorporate such function into my code ? – user2691544 Apr 23 '14 at 15:43
  • If you have the curve fitting toolbox, you can use the `smooth()` function. – Doug Lipinski Apr 23 '14 at 17:20

1 Answers1

1

Try

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

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

Community
  • 1
  • 1
Mathias
  • 1,470
  • 10
  • 20