change ytick in yyaxis
Afficher commentaires plus anciens
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 commentaire
Henrik Schädlich
le 24 Nov 2017
Modifié(e) : Henrik Schädlich
le 24 Nov 2017
Réponses (0)
Catégories
En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!