How Can I write the gamma symbol on the x axis as in the attached plot
clear;
close all;
clc;
dt = 0.0001;
tx = -10:dt:10;
th = 0.1:dt:1;
sigma = 3;
N = 5; % no of observation...
x = (1/sqrt(sigma^2 * 2*pi))^1 * exp(-1 * ((tx+4).^2)/ (2*sigma^2));
y = (1/sqrt(sigma^2 * 2*pi))^1 * exp(-1 * ((tx-4).^2)/ (2*sigma^2));
plot(tx, x)
hold on
plot(tx,y)
grid on
line([-4 -4],[0 0.133],'Marker','.','LineStyle','-.','LineWidth',1, 'Color',[0 0 0])
line([4 4],[0 0.133],'Marker','.','LineStyle','-.','LineWidth',1, 'Color',[0 0 0])
set(gca,'XTick',[]);
set(gca,'YTick',[]);
legend({' $P_0(y)$','$ P_1(y)$'},'Interpreter','latex','Location','northwest')

 採用された回答

Walter Roberson
Walter Roberson 2018 年 5 月 30 日

1 投票

xlabel('${\gamma}1$', 'interpreter','latex')
Or in your situation, I would proceed by setting XTick values where the lines go, and then setting XTickLabels to the strings you want.

3 件のコメント

Tammun filistin
Tammun filistin 2018 年 5 月 30 日
編集済み: Walter Roberson 2018 年 5 月 30 日
But I need it to be put it under the vertical lines because it represent the threshold on that places '${\gamma}0$' and '${\gamma}1$' respectively..
Thank you,
Walter Roberson
Walter Roberson 2018 年 5 月 30 日
set(gca, 'XTick', [-4 4], 'XTickLabels', {'${\gamma}0$','${\gamma}1$'}, 'TickLabelInterpreter', 'latex')
Tammun filistin
Tammun filistin 2018 年 5 月 31 日
Exactly what ı wanted ...Many thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by