Create a solid line instead of single points in the plot
7 次查看(过去 30 天)
显示 更早的评论
My Problem is I calculated curves out of 81 Data points and want to plot it as a solid line. If I plot it, the only way it shows the curve is as points, stars etc. As you can see in the picture below.
I have to do this seven times.
The code for this is:
imax is from 1 to 7 an (each curve)
N is from 1 to 81 and are my data points
The rest is calculated before but not relevant for the problem
vR=ones(imax,N);
FZA2=ones(imax,N);
vR(k,h)=(2*pi*rdyn)*(nR(k,h)/60)*3.6;
FZA2(k,h)=(T2(h,1)*i2(k)*i2E*nges)/rdyn; %in N
plot(vR(1,h),FZA2(1,h),'.b',vR(2,h),FZA2(2,h),'.r',vR(3,h),FZA2(3,h),'.g',vR(4,h),FZA2(4,h),'.c',vR(5,h),FZA2(5,h),'.y',vR(6,h),FZA2(6,h),'.m',vR(7,h),FZA2(7,h),'.b');
0 个评论
回答(2 个)
VBBV
2024-4-24
If the plot function is inside a loop, you could put it outside the loop as shown below, in order to plot solid line
plot(vR(1,:),FZA2(1,:),'b-',vR(2,:),FZA2(2,:),'r-',vR(3,:),FZA2(3,:),'g-', ...
vR(4,:),FZA2(4,:),'c-',vR(5,:),FZA2(5,:),'y-',vR(6,:),FZA2(6,:),'m-',vR(7,:),FZA2(7,:),'b-');
1 个评论
Steven Lord
2024-4-24
Rather than plotting individual points inside a loop (as @VBBV and I both suspect you are doing) you could pull the plot command out of the loop (as VBBV suggested previously) or you could create an animatedline before the loop and addpoints to it inside the loop.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!