change ytick in yyaxis

6 ビュー (過去 30 日間)
Henrik Schädlich
Henrik Schädlich 2017 年 11 月 24 日
編集済み: Henrik Schädlich 2017 年 11 月 24 日
Hello. I am now trying to solve a problem with the yticks for my yyaxis plot. The example is:
clear all
close all
%%figure
fig = figure (1);
set(fig, 'Units', 'normalized', 'Position', [0.2, 0.1, 0.5, 0.3]);
%%Plot data
%First subplot
ax1 = subplot(121)
x1 = linspace(1, 1000,1000);
y11 = x1.^2;
y12 = x1;
yyaxis left
semilogy(x1,1./(y11+200),'LineWidth',1.5);
ax1.YAxis(1).Limits = ([1e-4, 1e-3]);
grid on
ax1.GridColor = [0.1, 0.1, 0.1]; % [R, G, B]
ax1.GridAlpha = 0.5;
yyaxis right
plot(x1,1./y12,'LineWidth',1.5);
ax1.YAxis(2).Limits = ([1e-3,1e-2]);
%Second subplot
ax2 = subplot(122);
plot(x1,exp(x1),'LineWidth',1.5);
grid on;
ax2.GridColor = [0.1, 0.1, 0.1]; % [R, G, B]
ax2.GridAlpha = 0.5;
What i want is the valeue of 1e-4 and 1e-3 with Yticks in between without any value attached to it.
How can I set this one to 'on'.
set(ax1,'YMinorTick','off','YMinorGrid','on')
  1 件のコメント
Henrik Schädlich
Henrik Schädlich 2017 年 11 月 24 日
編集済み: Henrik Schädlich 2017 年 11 月 24 日
It seems that the option is set to on. But I still can't see them.
ax1.YAxis(1).MinorTick % Should be not visible
ax1.YAxis(1).MinorGrid % Not defined
Of course it would be nice to know, how to change the grid option for this problem too.

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeInteractive Control and Callbacks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by