MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Decimals from the "Get Coordinates" Tool

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94730] Re: Decimals from the "Get Coordinates" Tool
  • From: ADL <alberto.dilullo at tiscali.it>
  • Date: Mon, 22 Dec 2008 05:15:24 -0500 (EST)
  • References: <giikcm$9ng$1@smc.vnet.net> <gil764$85e$1@smc.vnet.net>

Following Sjoerd suggestion, I tried the following and it works (at
least for my purpose):

cg[x_] := (SetPrecision[#, $MachinePrecision] & /@ x);
dg[x_] := (InputForm /@ x);
Plot[Sin[x], {x, 170000, 170005},
   CoordinatesToolOptions -> {"CopiedValueFunction" -> cg,
"DisplayFunction" -> dg}
]

It displays with full precision and the copied numbers are like:
{{170000.67704280154`15.954589770191003,
  0.31624935654522957`15.954589770191003}, \
{170000.77042801556`15.954589770191003,
  0.22805361891912668`15.954589770191003}, \
{170000.86381322957`15.954589770191,
  0.13985788129302423`15.954589770191003}}

It seems that the copy function works internally like Print, so that
it applies the same truncation rules.
By explicitely setting precision, these rules preserve in the
clipboard all the decimals.

By the way, InputForm works well for "DisplayFunction" but is useless
for "CopiedValueFunction".
Probably, these options should be re-engineerd to give a more obvious
behavior.

Thanks for your help

ADL

On 21 Dic, 11:52, "sjoerd.c.devr... at gmail.com"
<sjoerd.c.devr... at gmail.com> wrote:
> As of M7 a CoordinatesToolOptions option is added to various plot
> functions. Adding a home-made Identity function to the functions
> defined within in it does the trick. I don't know why Identity itself
> doesn't work, but it doesn't, and neither do various other functions
> that I tried, like N[#,200]& or so.
>
> g[x_] := x;
> Plot[Sin[x], {x, 170000, 170005},  CoordinatesToolOptions ->
> {"CopiedValueFunction" -> g,  "DisplayFunction" -> g}]
>
> Cheers -- Sjoerd
>
> On Dec 20, 1:19 pm, ADL <alberto.dilu... at tiscali.it> wrote:


  • Prev by Date: Re: Need Help
  • Next by Date: Howto convert a 2D graphic to a 3D graphic
  • Previous by thread: Re: Decimals from the "Get Coordinates" Tool
  • Next by thread: Re: triple integration