Creating a plot that changes colour as the month changes
Afficher commentaires plus anciens
Hi,
Im trying to use the month function and a for-loop to find and plot specific data according to different months, for example january would be red and february would be blue, the data that is provided already has time stamp values.
1 commentaire
Original question by Sebastion Sunny retrieved from Google Cache:
Creating a plot that changes colour as the month changes
Hi,
Im trying to use the month function and a for-loop to find and plot specific data according to different months, for example january would be red and february would be blue, the data that is provided already has time stamp values. Also, the problem requires me to use the month and a for loop functions.I have attached the data below and the code here:
stdofpowerratedpower = (windTurbineData.std_Power_kW)/(7000);
PowerOutputRatingPower = (windTurbineData.mean_Power_kW)/(7000);
c = hsv(12);
for = 1:12
subplot (2,2,[1 2])
plot(timeData,PowerOutputRatingPower);% plotting mean,max,min of Power
ylim([-0.2,1.2]);
title('Power Output 2019')
ylabel('Poweroutput/rated power [-]')
end
subplot (2,2,3)
plot(windTurbineData.mean_WindSpeed_mps,PowerOutputRatingPower,'.')
xlabel('Windspeed m/s')
ylabel('Power output/ rated power')
ylim([-0.2 1.2])
colorbar('Ticks',linspace(0,1,12),'TickLabels',{'Jan','Feb','March','April','May','June','July','August','Sept','Oct','Nov','Dec'})
set(gca,'Colormap',c)
subplot (2,2,4)
plot(windTurbineData.mean_WindSpeed_mps,stdofpowerratedpower,'.')
xlabel('Windspeed m/s')
ylabel('Std Power output/ rated power')
colorbar('Ticks',linspace(0,1,12),'TickLabels',{'Jan','Feb','March','April','May','June','July','August','Sept','Oct','Nov','Dec'})
set(gca,'Colormap',c)
Thank you
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 2 Déc 2021
0 votes
Catégories
En savoir plus sur Scatter Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
