Path: news.mathworks.com!not-for-mail
From: "helper " <spamless@nospam.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: change data format in plot window?
Date: Thu, 8 May 2008 10:48:03 +0000 (UTC)
Organization: Timothy S. Farajian, Inc.
Lines: 41
Message-ID: <fvulp3$pgl$1@fred.mathworks.com>
References: <fvuf1f$4g5$1@fred.mathworks.com>
Reply-To: "helper " <spamless@nospam.com>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210243683 26133 172.30.248.38 (8 May 2008 10:48:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 8 May 2008 10:48:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1272923
Xref: news.mathworks.com comp.soft-sys.matlab:467352


"Holger Kirchhoff" <holkir@cs.tu-berlin.de> wrote in 
message <fvuf1f$4g5$1@fred.mathworks.com>...
> Hi,
> 
> I could imagine that other people had this problem, but I
> did not find anything similar by using the newsgroup 
search:
> 
> Is there a way to change the format the data is displayed 
in
> the plot window? If I plot vectors with more than 10^5
> elements and want to find out an exact index position by
> zooming into the plot, the numeric format is limited to 4
> digits after the decimal point (like the 'short e'-format 
in
> the command window), and it is not directly possible to
> determine the exact index of a data point.
> This is especially annoying when you display vectors with
> even more elements. E.g. a displayed index of "1.2345 x
> 10^8" could be any index between 123450000 and 123459999.
> 
> If it is not possible to change the data format of the 
axes,
> is it optionally possible to change the data format of the
> data cursor? I know, that it is possible to export the 
value
> of the data cursor to a workspace-variable and display it
> there in your favorite format, but if you want to check 
many
> data points quickly, this becomes very laborious.
> 
> Any suggestions?
> 
> Holger


After plotting your data, try this convoluted command which 
will print 15 decimal places in the data cursor:

set(datacursormode,'UpdateFcn',@(Y,X){sprintf('X: %
0.15f',X.Position(1)),sprintf('Y: %0.15f',X.Position(2))})