Thread Subject: semilogy loop problem

Subject: semilogy loop problem

From: Terence Mc Cartan

Date: 15 Nov, 2005 12:41:53

Message: 1 of 4

Hi all,
having trouble gettin a 'semilogy' plot. I have the command in a
'for' loop to plot about 20 lines using 'hold on' also. But when the
plot comes out its on a linear linear scale.
Ill appreciate any suggestions
thanks

Subject: semilogy loop problem

From: Duane Bozarth

Date: 15 Nov, 2005 11:36:57

Message: 2 of 4

Terence Mc Cartan wrote:
>
> Hi all,
> having trouble gettin a 'semilogy' plot. I have the command in a
> 'for' loop to plot about 20 lines using 'hold on' also. But when the
> plot comes out its on a linear linear scale.
> Ill appreciate any suggestions
> thanks

Have any zero or negative values in the data--that's the only case I can
recall where the axes were reset to linear.

That not being the problem, if you save the handle of the axes object
you can reset the scale property back to 'log'.

Subject: semilogy loop problem

From: Hao Yuan

Date: 9 Feb, 2010 10:59:04

Message: 3 of 4

I had the same problem, I haven't figured out any solution yet.....Hoping some super guy can fix it....
It sounds like a bug definitely..



"Terence Mc Cartan" <mrterencemccartan@gmail.com> wrote in message <ef1ba8d.-1@webx.raydaftYaTP>...
> Hi all,
> having trouble gettin a 'semilogy' plot. I have the command in a
> 'for' loop to plot about 20 lines using 'hold on' also. But when the
> plot comes out its on a linear linear scale.
> Ill appreciate any suggestions
> thanks

Subject: semilogy loop problem

From: Steven Lord

Date: 9 Feb, 2010 14:50:51

Message: 4 of 4


"Hao Yuan" <toxiccool@hotmail.com> wrote in message
news:hkrf5o$4q2$1@fred.mathworks.com...
>I had the same problem, I haven't figured out any solution yet.....Hoping
>some super guy can fix it....
> It sounds like a bug definitely..
>
>
>
> "Terence Mc Cartan" <mrterencemccartan@gmail.com> wrote in message
> <ef1ba8d.-1@webx.raydaftYaTP>...
>> Hi all,
>> having trouble gettin a 'semilogy' plot. I have the command in a
>> 'for' loop to plot about 20 lines using 'hold on' also. But when the
>> plot comes out its on a linear linear scale.
>> Ill appreciate any suggestions

Post your code. Depending on which command you call first, before the HOLD,
you could get either both plots on a linear y scale or both on a log y
scale.

% both plots on a linear y scale due to HOLD ON holding the "linearness" of
the Y axis
plot(1:10, 1:10);
hold on;
% SEMILOGY can't change the held YScale property of the axes
semilogy(1:10, 100:100:1000)

% Similarly, both plots will be on a log y scale due to HOLD ON
semilogy(1:10, 100:100:1000);
hold on;
% Normally PLOT resets many axes properties, including YScale, to their
defaults
% but due to HOLD ON, it cannot
plot(1:10, 1:10)

If you want to _force_ the first example to give you a log y scale,
explicitly set the YScale property after executing that code (or even just
after executing the PLOT call.)

plot(1:10, 1:10);
set(gca, 'YScale', 'log');
hold on;
% SEMILOGY can't change the held YScale property of the axes
semilogy(1:10, 100:100:1000)

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com