how to plot ecdf with > 0 value in a subplot?

1 vue (au cours des 30 derniers jours)
Hydro
Hydro le 22 Sep 2017
Commenté : Hydro le 22 Sep 2017
Hello all, I am biased correcting climate data. In Figure below subplot (a) and (b) are fine as data is less or greater than zero, however, subplot (c) due to a lot of zero values, the bias correction doesn't appear very clear. Is there anyway, I can plot only data that correspond to values greater > 0. Here is my code and the sample figure
subplot(1,3,1)
[f,x]=ecdf(BMinT_his_EC);
plot(x,f,'r','LineWidth',1)
hold on
[f,x]=ecdf(BMinT_his_RRCM5);
plot(x,f,'k','LineWidth',1)
[f,x]=ecdf(BMinT_his_CRCM5);
plot(x,f,'b','LineWidth',1)
hold off
text(-40,0.95,'$\textcircled{\bf a}$', 'Interpreter', 'latex','color','k','FontSize',20);
axis tight
ylabel('Cumulitive frequency');
xlabel('Temperature (\circC)')
subplot(1,3,2)
[f,x]=ecdf(BMaxT_his_EC);
plot(x,f,'r','LineWidth',1)
hold on
[f,x]=ecdf(BMaxT_his_RRCM5);
plot(x,f,'k','LineWidth',1)
[f,x]=ecdf(BMaxT_his_CRCM5);
plot(x,f,'b','LineWidth',1)
hold off
text(-40,0.95,'$\textcircled{\bf b}$', 'Interpreter', 'latex','color','k','FontSize',20);
axis tight
ylabel('Cumulitive frequency');
xlabel('Temperature (\circC)')
subplot(1,3,3)
[f,x]=ecdf(BPrec_his_EC);
plot(x,f,'r','LineWidth',1)
hold on
[f,x]=ecdf(BPrec_his_RRCM5);
plot(x,f,'k','LineWidth',1)
[f,x]=ecdf(BPrec_his_CRCM5);
plot(x,f,'b','LineWidth',1)
hold off
text(60,0.95,'$\textcircled{\bf c}$', 'Interpreter', 'latex','color','k','FontSize',20);
ylabel('Cumulitive frequency');
xlabel('Precipitation (mm)')
set(gcf,'NextPlot','add');
axes;
set(gca,'Visible','off');
h = title('Bias correction of Regional Climate Modem (RCM) ver 4','fontweight','b','fontSize',16);
set(h,'Visible','on');

Réponse acceptée

the cyclist
the cyclist le 22 Sep 2017
You can manipulate the data to get what you want to do, but I think it is easier to just zoom in on the relevant part of the plot. How about just doing
set(gca,'YLim',[0.7 1])
  1 commentaire
Hydro
Hydro le 22 Sep 2017
Like this one too. Many thanks

Connectez-vous pour commenter.

Plus de réponses (1)

Cam Salzberger
Cam Salzberger le 22 Sep 2017
whichVals = x > 0;
plot(x(whichVals), f(whichVals), ...)
-Cam
  4 commentaires
the cyclist
the cyclist le 22 Sep 2017
Sorry, I misread Cam's code completely. I thought he was doing the ecdf with the modified BPrec_his_EC values. His approach is perfect.
Hydro
Hydro le 22 Sep 2017
Many thanks to both of you. I ended up using cyclist solution.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Axes Appearance dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by