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.
1 个评论
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
采纳的回答
更多回答(1 个)
Walter Roberson
2021-12-2
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Scatter Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
