change ytick in yyaxis

6 visualizzazioni (ultimi 30 giorni)
Henrik Schädlich
Henrik Schädlich il 24 Nov 2017
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 Commento
Henrik Schädlich
Henrik Schädlich il 24 Nov 2017
Modificato: Henrik Schädlich il 24 Nov 2017
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.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Interactive Control and Callbacks in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by