How do I change 1e-5 on a loglog axis out of scientific notation?
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
0 votes
Accepted Answer

7 Comments
This is closer for sure. Is there a way to kill the trailing zeros using the compose function?
- @Walter Roberson: As you observed, the Exponent has no effect when in log-scale. This is in the documentation, but it is quite easy to miss, as it is strapped onto the end of another sentence at the end of the property description. "If the axis has a log scale, then the Exponent property has no effect."
- The value of the YTickLabel property is always going to be either a character matrix or a cell-array. If you set the value to be a numeric vector, then the value is immediately converted into a cell-array using an internal algorithm that cannot be customized and is not impacted by any other settings in MATLAB. Ultimately, the internal code is calling the C++ function snprintf.
- If you want to specify how the numbers are converted into strings, then you need to do the conversion yourself, as you did above using either compose, sprintf, or num2str. Each of those commands have their own unique behaviors. I believe num2str is a very similar algorithm to what is used by the YTickLabel property, but I'm not certain of that.
- I couldn't find a solution that automatically trimmed the trailing zeros without requiring some manual intervention (such as using strip, as you did above).
More Answers (0)
Categories
Find more on Axis Labels in Help Center and File Exchange
Tags
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)