Reputation: 951
I want to plot 3D graph where Y-axis has only values 9, 99 , 999. I tried to use
Y= [9, 99 , 999];
set(gca,'YTickLabel',Y);
set(gca,'YTick',Y);
I want to have 3 points 9 at the beginning, 99 in the middle, and 999 at the end. Is it possible to do that?. I tried also with Ylim, but couldn't help
Upvotes: 2
Views: 55
Reputation: 5126
Another solution:
F = [1 2 3];
Y = [9, 99 , 999];
Y_ = [9, (999-99)/2 , 999];
figure;
subplot(1,2,1)
plot(Y,F,'*-');
set(gca,'XTickLabel',Y,'XTick',Y);
subplot(1,2,2)
plot(Y_,F,'o-');
set(gca,'XTickLabel',Y,'XTick',Y_);
You can see the difference:
Upvotes: 0
Reputation: 7895
You can change your y
-axis to a logarithmic scale.
Use:
set(gca, 'YScale', 'log');
If you also set
ylim([9 999]);
as you had pointed out, you should get the desired result.
Upvotes: 2