您好我有以下代码输出下图。但是我想删除连接绿线上两条曲线的绿色水平线。 我怎么能这样做并保持相同的颜色? 谢谢
Y = xlsread('hanimaadhoo_sun_path.xls','hanimaadhoo'); %
azimuth_march_equinox = Y(1:17,1);
altitude_march_equinox = Y(1:17,2);
azimuth_september_equinox = Y(1:17,3);
altitude_september_equinox =Y(1:17,4);
azimuth_winter_solstice = Y(1:17,5);
altitude_winter_solstice = Y(1:17,6);
azimuth_summer_solstice = Y(1:17,7);
altitude_summer_solstice = Y(1:17,8);
figure;
plot(azimuth_summer_solstice,altitude_summer_solstice,azimuth_winter_solstice,altitude_winter_solstice,...
azimuth_march_equinox,altitude_march_equinox,azimuth_september_equinox,altitude_september_equinox,'LineWidth',2);
答案 0 :(得分:0)
您应该将它们绘制为2个单独的图。此外,您应该明确定义颜色:
plot(azimuth_summer_solstice,altitude_summer_solstice,... azimuth_march_equinox,altitude_march_equinox,azimuth_september_equinox,altitude_september_equinox,'LineWidth',2);
% Now plot winter in 2 parts!
n = .... %Something
plot(azimuth_winter_solstice(1:n), altitude_winter_solstice(1:n),'g','LineWidth',2);
plot(azimuth_winter_solstice(n+1:end), altitude_winter_solstice(n+1:end),'g','LineWidth',2);
请务必在运行前填写正确的n
。