Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The # of signinficant digits in Matlab plot

  1. May 12, 2010 #1
    When I plot a function using MATLAB where the y-axis, for example, has values of : 1.8, 1.9, 2.0 , 2.1

    Matlab ignores the number of siginficant digits when printing the value of 2.0, so it prints out:

    1.8, 1.9, 2, 2.1

    It there a way to change this?

    Thank you in advance
  2. jcsd
  3. May 13, 2010 #2
    XTickLabel is a property of the graph which you can set, and you can set it as strings so MATLAB doesn't automatically round the numbers off.

    For example:

    Code (Text):

    >> set(gca,'XTickLabel',{'1.8';'1.9';'2.0';'2.1';'2.2'})
    The hassle is you have to type all the other ones as well, but it works. There might be a shortcut.
  4. May 13, 2010 #3
    Thank you very much! It worked!
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - signinficant digits Matlab Date
Matlab Coding angular spectrum of waves in a fluid Thursday at 7:30 AM
[Mathematica] Number problem with digits Jun 21, 2014
100 Digit Calculator / Program Sep 27, 2012
Print particular digits of pi Nov 13, 2011
How to filter an EEG digital signal with Matlab? Jun 4, 2007