Got Questions? Get Answers.
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:
convert axis values from e.g. 5e+2 to 5*10^2

Subject: convert axis values from e.g. 5e+2 to 5*10^2

From: Catalin Eberhardt

Date: 8 Feb, 2009 04:24:01

Message: 1 of 3

I'm trying to make values displayed on the log-scale axis of my plot as meaningful as possible, and towards that goal I found this very useful file in the Exchange - http://www.mathworks.com/matlabcentral/fileexchange/11563 - that allows easy customisation of the values that are displayed on the log axis.

The only problem is, I would really want the values to be displayed in regular scientific (exponential) notation, with superscripts, e.g. 5*10^2, rather than in the format in which they are currently displayed (e.g. 5e+2, see program screenshot at http://www.mathworks.com/matlabcentral/fx_files/11563/1/logticks.png )

Does anyone know a way to do this? Thanks very much in anticipation.

Subject: convert axis values from e.g. 5e+2 to 5*10^2

From: Godzilla

Date: 9 Feb, 2009 04:05:03

Message: 2 of 3

"Catalin Eberhardt" <longtalker@gmail.com> wrote in message <gmlmp1$7be$1@fred.mathworks.com>...
> I'm trying to make values displayed on the log-scale axis of my plot as meaningful as possible, and towards that goal I found this very useful file in the Exchange - http://www.mathworks.com/matlabcentral/fileexchange/11563 - that allows easy customisation of the values that are displayed on the log axis.
>
> The only problem is, I would really want the values to be displayed in regular scientific (exponential) notation, with superscripts, e.g. 5*10^2, rather than in the format in which they are currently displayed (e.g. 5e+2, see program screenshot at http://www.mathworks.com/matlabcentral/fx_files/11563/1/logticks.png )
>
> Does anyone know a way to do this? Thanks very much in anticipation.

Have you tried to just patch the line in logticks.m where the tick labels are made?

I would try using
sprintf('y = %4.1fx^{%4.2f}',a,b)
where a = mantissa and b = exponent

Subject: convert axis values from e.g. 5e+2 to 5*10^2

From: Catalin Eberhardt

Date: 9 Feb, 2009 10:33:01

Message: 3 of 3

Thanks for your reply. I patched the said line in logticks as you said, and everything's ok except for the fact that the exponential isn't actually displayed as a superscript, but literally as ^exponent. This is strange because normally using a^{b} displays b in superscript.

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