how can I show my Xaxis format like 10^..?

2 ビュー (過去 30 日間)
Samaneh Arzpeima
Samaneh Arzpeima 2020 年 4 月 5 日
コメント済み: Ameer Hamza 2020 年 4 月 5 日
Hi everyone
I am facing a deadline and stuck in my x-axis format
I would appriciate if you give me some prompt advice
I read a part of excel, made a subset ,the column that I want to place on my x-axis is like 2.4e+04
but when I plot the data, the xaxis change to 2.4
what should I do?
this is the code
figure(3)
plot(subsetA(1:7,30),subsetA(1:7,4),'-o','LineWidth',2)
hold on
plot(subsetA(8:14,30),subsetA(8:14,4),'-o','LineWidth',2)
plot(subsetA(15:end,30),subsetA(15:end,4),'-o','LineWidth',2)
legend('S<1','S=1','S>1','FontSize',14,...
'Location','best')
ylim([80 200])
xlim([1.5e+04 4e+04])
a = get(gca,'XTickLabel');
set(gca,'XTickLabel',a,'FontName','Times','fontsize',14)
b = get(gca,'YTickLabel');
set(gca,'YTickLabel',b,'FontName','Times','fontsize',14)
xlabel('$\frac{\Delta\sigma\times asp_{radius}}{background \_G_{c}}$','Interpreter','latex','FontSize',14,'FontWeight','bold');
ylabel('Rupture Area [km^2]','FontSize',14,'FontWeight','bold');

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 5 日
編集済み: Ameer Hamza 2020 年 4 月 5 日
There are several redundant steps in your code. Try this
figure(3)
plot(subsetA(1:7,30),subsetA(1:7,4),'-o','LineWidth',2)
hold on
plot(subsetA(8:14,30),subsetA(8:14,4),'-o','LineWidth',2)
plot(subsetA(15:end,30),subsetA(15:end,4),'-o','LineWidth',2)
legend('S<1','S=1','S>1','FontSize',14,...
'Location','best')
ylim([80 200])
xlim([1.5e+04 4e+04])
set(gca,'FontName','Times','fontsize',14)
xlabel('$\frac{\Delta\sigma\times asp_{radius}}{background \_G_{c}}$','Interpreter','latex','FontSize',14,'FontWeight','bold');
ylabel('Rupture Area [km^2]','FontSize',14,'FontWeight','bold');
  4 件のコメント
Samaneh Arzpeima
Samaneh Arzpeima 2020 年 4 月 5 日
sorry seems I had made a mistake .after putting a "hold off " before figure(3)) and run the
set('FontName','Times','fontsize',14)
I got that 10^4, but still with an error
error:set
handel not defined
Ameer Hamza
Ameer Hamza 2020 年 4 月 5 日
Sorry, there was a mistake in my code. I have corrected it. I have changed the following line
set(gca,'FontName','Times','fontsize',14)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAxis Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by