How to make part of my solid line dashed?

조회 수: 10 (최근 30일)
Gabi Pipkin
Gabi Pipkin 2023년 4월 10일
답변: Cris LaPierre 2023년 4월 10일
I am plotting a series of data points and where the Mc>Mo I want to be dashed. This image is how I want my graph to look
This is how it currently looks
This is the code I currently have for my plot if someone could tell me what to add to create that dashed line that would be helpful.
Mc = [0, 1, 2, 2.93, 4];
Mo=linspace(0,14,10000);
figure(1)
plot(Mo,SThrust,'Linewidth',2);
title('Ideal Scramjet Specific Thrust vs Freestream Mach Number');
xlabel('Mo');
ylabel('Specific Thrust (N/(kg/s)');
lgd=legend('Mc=0','Mc=1','Mc=2.0','Mc=2.93','Mc=4','Location','northeast');
lgd.FontSize=12;

답변 (1개)

Cris LaPierre
Cris LaPierre 2023년 4월 10일
A data series (one line) can only have one line style. If you want 2 different line styles, you will need to split your series into two and plot each one with the desired line style.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by