Thread Subject: display of plot axis exponent

Subject: display of plot axis exponent

From: Phil Newman

Date: 12 Apr, 2007 03:40:57

Message: 1 of 2

Hi,

I have a graph which usually plots x-values between 100 and 500.
However, sometimes it is required that x-values range between 8000 and
20000.

when this is displayed on the plot, the x-values are displayed as 0.8
- 2 x 10^4, which looks ugly.

there are two ways i propose round this:

1. get the plot to display the actual numbers, 8000 - 20000. How can
I do this?

2. Find the exponent of the x-values (ie 4) and then divide the x-
values through by the appropriate scaling to give 800-2000, which can
be displayed properly. an if statement can change the x-label
appropriately. How can I find the exponent of a number like this?


Thanks,

Phil

Subject: display of plot axis exponent

From: Martti

Date: 28 Mar, 2008 10:25:05

Message: 2 of 2

"Phil Newman" <phillenium2002@hotmail.com> wrote in message
<1176374457.297422.247060@q75g2000hsh.googlegroups.com>...
> Hi,
>
> I have a graph which usually plots x-values between 100
and 500.
> However, sometimes it is required that x-values range
between 8000 and
> 20000.
>
> when this is displayed on the plot, the x-values are
displayed as 0.8
> - 2 x 10^4, which looks ugly.
>
> there are two ways i propose round this:
>
> 1. get the plot to display the actual numbers, 8000 -
20000. How can
> I do this?
>
> 2. Find the exponent of the x-values (ie 4) and then
divide the x-
> values through by the appropriate scaling to give 800-
2000, which can
> be displayed properly. an if statement can change the x-
label
> appropriately. How can I find the exponent of a number
like this?
>
>
> Thanks,
>
> Phil
>


For workaround 1, try

>> set(gca, 'XTickLabel', ...
cellstr(num2str(get(gca, 'XTick')', '%.0f')))

-Martti

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

Public Submission Policy

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 Disclaimer prior to use.

Contact us at files@mathworks.com