Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
change of tick intervals

Subject: change of tick intervals

From: gati

Date: 26 Jan, 2013 16:33:08

Message: 1 of 5

hi!
I m getting a graph whose y axis limits are from 0 to 10^8 having tick intervals of 1*10^8. Now as my one function plots around 10^8 and other somewhere at 10^6. The second function is not visible as the first limit starts from 10^8. So i want to change the limits from 10^0 to 10^8 having tick intervals of 10^2. So please help me. I have also tried to use - set(gca,'ylim',[0 10^8], 'ytick',[0:10^2:10^8],'yticklabel',[0:10^2:10^8]) but this could'nt worked.

Subject: change of tick intervals

From: dpb

Date: 26 Jan, 2013 17:24:29

Message: 2 of 5

On 1/26/2013 10:33 AM, gati wrote:
> hi! I m getting a graph whose y axis limits are from 0 to 10^8 having
> tick intervals of 1*10^8. Now as my one function plots around 10^8 and
> other somewhere at 10^6. The second function is not visible as the first
> limit starts from 10^8. So i want to change the limits from 10^0 to 10^8
> having tick intervals of 10^2. So please help me. I have also tried to
> use - set(gca,'ylim',[0 10^8],
> 'ytick',[0:10^2:10^8],'yticklabel',[0:10^2:10^8]) but this could'nt worked.

Won't matter what the tick marks are; the scale difference will be too
great to see the smaller range on the same axis as the larger...

I see two alternatives--

a) semilogx()

b) use separate x-axes (essentially plotyy excepting it would be plotxx)
  See the documentation for samples on 'using multiple axes'

--

Subject: change of tick intervals

From: gati

Date: 27 Jan, 2013 19:18:08

Message: 3 of 5

dpb <none@non.net> wrote in message <ke13g0$bk7$1@speranza.aioe.org>...
> On 1/26/2013 10:33 AM, gati wrote:
> > hi! I m getting a graph whose y axis limits are from 0 to 10^8 having
> > tick intervals of 1*10^8. Now as my one function plots around 10^8 and
> > other somewhere at 10^6. The second function is not visible as the first
> > limit starts from 10^8. So i want to change the limits from 10^0 to 10^8
> > having tick intervals of 10^2. So please help me. I have also tried to
> > use - set(gca,'ylim',[0 10^8],
> > 'ytick',[0:10^2:10^8],'yticklabel',[0:10^2:10^8]) but this could'nt worked.
>
> Won't matter what the tick marks are; the scale difference will be too
> great to see the smaller range on the same axis as the larger...
>
> I see two alternatives--
>
> a) semilogx()
>
> b) use separate x-axes (essentially plotyy excepting it would be plotxx)
> See the documentation for samples on 'using multiple axes'
>
> --Thanks, but now the graph shows below limit 0, now how to ignore negative limits.

Subject: change of tick intervals

From: dpb

Date: 27 Jan, 2013 20:05:29

Message: 4 of 5

On 1/27/2013 1:18 PM, gati wrote:
> dpb <none@non.net> wrote in message <ke13g0$bk7$1@speranza.aioe.org>...
>> On 1/26/2013 10:33 AM, gati wrote:
>> > hi! I m getting a graph whose y axis limits are from 0 to 10^8 having
>> > tick intervals of 1*10^8. Now as my one function plots around 10^8 and
>> > other somewhere at 10^6. The second function is not visible as the
>> first
>> > limit starts from 10^8. So i want to change the limits from 10^0 to
>> 10^8
>> > having tick intervals of 10^2. So please help me. I have also tried to
>> > use - set(gca,'ylim',[0 10^8],
>> > 'ytick',[0:10^2:10^8],'yticklabel',[0:10^2:10^8]) but this could'nt
>> worked.
>>
>> Won't matter what the tick marks are; the scale difference will be too
>> great to see the smaller range on the same axis as the larger...
>>
>> I see two alternatives--
>>
>> a) semilogx()
>>
>> b) use separate x-axes (essentially plotyy excepting it would be
>> plotxx) See the documentation for samples on 'using multiple axes'
>>
>> --Thanks, but now the graph shows below limit 0, now how to ignore
>> negative limits.

I see somehow I got off on x-axis rather than y but same idea...

Well, if you have numeric values <0 but of such different magnitudes try
plotyy(). Log() exists only for x>0.

A _short_ sample of the data you're trying to plot might help if there's
something unusual not explained going on here...

--

Subject: change of tick intervals

From: gati

Date: 30 Jan, 2013 19:23:08

Message: 5 of 5

dpb <none@non.net> wrote in message <ke41aa$meh$1@speranza.aioe.org>...
> On 1/27/2013 1:18 PM, gati wrote:
> > dpb <none@non.net> wrote in message <ke13g0$bk7$1@speranza.aioe.org>...
> >> On 1/26/2013 10:33 AM, gati wrote:
> >> > hi! I m getting a graph whose y axis limits are from 0 to 10^8 having
> >> > tick intervals of 1*10^8. Now as my one function plots around 10^8 and
> >> > other somewhere at 10^6. The second function is not visible as the
> >> first
> >> > limit starts from 10^8. So i want to change the limits from 10^0 to
> >> 10^8
> >> > having tick intervals of 10^2. So please help me. I have also tried to
> >> > use - set(gca,'ylim',[0 10^8],
> >> > 'ytick',[0:10^2:10^8],'yticklabel',[0:10^2:10^8]) but this could'nt
> >> worked.
> >>
> >> Won't matter what the tick marks are; the scale difference will be too
> >> great to see the smaller range on the same axis as the larger...
> >>
> >> I see two alternatives--
> >>

> >> a) semilogx()
> >>
> >> b) use separate x-axes (essentially plotyy excepting it would be
> >> plotxx) See the documentation for samples on 'using multiple axes'
> >>
> >> --Thanks, but now the graph shows below limit 0, now how to ignore
> >> negative limits.
>
> I see somehow I got off on x-axis rather than y but same idea...
>
> Well, if you have numeric values <0 but of such different magnitudes try
> plotyy(). Log() exists only for x>0.
>
> A _short_ sample of the data you're trying to plot might help if there's
> something unusual not explained going on here...
>

thanks dpb,
 i got the problem solved,as after using semilogy() i used
ylim([0.1 10^10]) and i got the positve graph.
> --

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us