change ytick in yyaxis
2 次查看(过去 30 天)
显示 更早的评论
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')
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!