Adding latex text to a curve in a matlab plot

62 ビュー (過去 30 日間)
Sagar D Patel
Sagar D Patel 2020 年 9 月 20 日
回答済み: Cris LaPierre 2020 年 9 月 20 日
After plotting the 2 points in a graph for x* and y*, I'm able to create a curve that a variable for both x* and y* through the following code:
v_mar_plot = linspace(0,9,9000);
z_plot = [0, 0.9];
omega_plot = [3.16];
p_index=3;
for j = z_plot
for i = omega_plot
for k = 1:length(p_index)
p(p_index) = plot(sort(v_mar_plot),q_mar_plot(i,sort(v_mar_plot),j));
end
end
end
I'm however unable to figure a way to add the text M_p^∗=3.16 at z^∗=0, and similarly M_p^∗=3.16 at z^∗=0.9 next to the curve through MATLAB. I would hence like help on how would it be possible to include this into the code itself so as to obtain as many labels as I create curves based on the input to z_plot that I add?

採用された回答

Cris LaPierre
Cris LaPierre 2020 年 9 月 20 日
Try using the text function and set the 'Interpreter' name-vale pair to 'latex'.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by