필터 지우기
필터 지우기

Graph limits and area

조회 수: 1 (최근 30일)
Mughees Asif
Mughees Asif 2019년 3월 6일
댓글: KSSV 2019년 3월 6일
I have the following code:
x = linspace(-5, 5, 1000);
y1 = -x;
y2 = x.^2-4;
lidx = y1 >= y2;
figure
set(findobj(gcf,'type','axes'),'FontName','Arial','FontSize',12,'FontWeight','Bold', 'LineWidth', 2);
plot(x, y1, 'k')
hold on
plot(x, y2, 'k')
patch([x(lidx) fliplr(x(lidx))], [y1(lidx), fliplr(y2(lidx))], 'b', 'FaceAlpha', 0.4)
hold off
xlim([-5 5])
ylim([-5 5])
box on
grid on
axis=gca;
axis.XAxisLocation = 'origin';
axis.YAxisLocation = 'origin';
title('Graph of the integration domain')
xlabel('x')
ylabel('y')
which gives the following graph. Is there a way of putting dashed lines where the green line is to show limits and to reduce the blue patch within the area. Thank you.
graph_Mathworks.png
  댓글 수: 1
KSSV
KSSV 2019년 3월 6일
Get those intersection points and use patch.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by