# How can I get more tick marks/precision plotyy()'s y-axis using set() or simple method?

51 visualizaciones (últimos 30 días)
Yuki Himekawa el 20 de Ag. de 2014
Comentada: the cyclist el 25 de Jul. de 2017
I'm currently plotting two data points sharing same independent variable, or I'm plotting the voltage and current versus time onto a single graph with y-axis on both sides as:
[haxes,h1,h2] = plotyy(Time,Voltage,Time,Current);
The data points I'm using is really large and I only want some portions of it so I'm also limiting the display range using:
set(haxes(1),'XLim',[Min Max],'YLim',[MinV MaxV]); %Sets Range set(haxes(2),'Xlim',[Min Max],'YLim',[MinI MaxI]);
When I plot this, I get a good number of tick marks on the X axis or time axis but I get very few number of tick marks displayed on the y-axis. I want something around third order decimal points for voltage and current but the voltage axis has tick marks on every 1 volt and current only has ticks marks on every 20 Amps which is way bigger than I want it. I was wondering if there was a way to get more tick marks using set() if there was some function like,
set(haxes(1),'TicksNumber','100')
that will set the number of tick marks or any other simple way to increase the number of tick marks.
##### 0 comentariosMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos

Iniciar sesión para comentar.

the cyclist el 20 de Ag. de 2014
You can set the ticks explicitly with the 'YTick' property, for example
set(haxes(1),'YTick',0:0.001:1)
##### 0 comentariosMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos

Iniciar sesión para comentar.

### Más respuestas (1)

Ben11 el 20 de Ag. de 2014
Yes you can set the Tick marks like this:
set(gca,'XTick',Begin:Increment:End);
so you can customize through the Increment the number of tick marks displayed.
##### 2 comentariosMostrar 1 comentario más antiguoOcultar 1 comentario más antiguo
the cyclist el 25 de Jul. de 2017
The current axes. See this documentation for details.

Iniciar sesión para comentar.

### Categorías

Más información sobre Axis Labels en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by