필터 지우기
필터 지우기

vertical line through all the subplots

조회 수: 34 (최근 30일)
Megha
Megha 2019년 2월 18일
댓글: Megha 2019년 2월 19일
How to give a long vertical line throughout one particular plot that contains multiple subplots.
I do not want annotation command.
I would like to use something like
line(x,y);
however this command does not show-up over entire range of subplots. I attach a smiliar figure below.
I want to specify (x,y) with respect to one of the subplots and then get a veritcal line througout the subplots.

채택된 답변

KSSV
KSSV 2019년 2월 18일
x = 1:10 ;
y = rand(1,10) ;
figure
hold on
plot(x,y)
x1 = 5*ones(1,10) ;
y1 = linspace(min(y),max(y),10);
plot(x1,y1,'--b','LineWidth',5)
  댓글 수: 4
Walter Roberson
Walter Roberson 2019년 2월 19일
When you say subplot, do you mean multiple lines draw in the same axes, or possibly even multiple overlapping axes? Or do you mean by using subplot() ?
If you mean by using subplot() then you have a few choices:
  1. Use annotation(), as annotation() ignores subplot boundarys
  2. create a large axes overlapping everything, and drawing the line inside that axes; you would set the background color of the axes to 'none' so the other axes show through. You have to be careful when you use subplot() with this, as subplot() will tend to delete overlapping axes
  3. pick one of the axes and turn clipping off for it, and then draw a line. It is possible to draw outside of an axes if clipping is off
Megha
Megha 2019년 2월 19일
Yes, @walter,
Clipping off worked for me!
Thank you so much.
Thank you KSSV for putting efforts

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by