Unexpected elements appear when using yyaxis plot

조회 수: 4 (최근 30일)
Duzitian Li
Duzitian Li 2023년 1월 11일
댓글: Divyanshu 2023년 2월 23일
When I am using yyaxis to plot different lines on both axis, something went wrong. After activating the right axis, I firstly add a line and everything went on just fine. But as I was trying to add more lines, there appeared some unexpected 'scatter's at the two endpoints. I have no idea what happened. Is there a limit of the number of lines that can be plotted on one axis?
yyaxis left
x_draw=(-3+1.5/14):3/14:(0-1.5/14);
% pl=plot(x_draw,count,'linewidth',5,'color',[65,105,225]./255);
a=area(x_draw,count,'linewidth',5,'facecolor',[65,105,225]./255,'edgecolor',[65,105,225]./255);
a.FaceAlpha=0.2;
hold on
x_star4=log10(0.02);
x_star5=log10(0.04);
x_star6=log10(0.08);
plot([x_star4 x_star4],[0 pro_4*15000],'Color',[178 34 34]./255,'linewidth',3,'linestyle','-')
plot([x_star5 x_star5],[0 pro_5*15000],'Color',[178 34 34]./255,'linewidth',3,'linestyle','-')
plot([x_star6 x_star6],[0 pro_6*15000],'Color',[178 34 34]./255,'linewidth',3,'linestyle','-')
plot([-x_star4 0],[pro_4*15000 pro_4*15000],'Color',[178 34 34]./255,'linewidth',3,'linestyle','-')
plot([-x_star5 0],[pro_5*15000 pro_5*15000],'Color',[178 34 34]./255,'linewidth',3,'linestyle','-')
plot([-x_star6 0],[pro_6*15000 pro_6*15000],'Color',[178 34 34]./255,'linewidth',3,'linestyle','-')
  댓글 수: 3
Adam Danz
Adam Danz 2023년 1월 11일
What part of the image shows this: " some unexpected 'scatter's at the two endpoints" ? What end points? What scatter?
Divyanshu
Divyanshu 2023년 2월 23일
Can you provide more information about the variables used in the code and also indicate which part of plot indicate that "scatter's at the two endpoints"?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by