Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

"Not a floating-point number" WHY?

0 views
Skip to first unread message

Henning Heiberg-Andersen

unread,
Oct 16, 2006, 3:20:01 AM10/16/06
to

Hi,

I have a hard time trying to understand why I get the floating-point error
in this
particular case: I dont't see what's wrong with the list I am trying to
plot.
Here it is:


In[1]:= small=Take[vec,2]

Out[1]:= { {30.06, 23523}, {56. 38,00005}}

In[2]:= ListPlot[small]

Then I get the error message:

Graphics::gptn : Coordinate 30.06 in {30.06, 23523} is not a floating-point
number.

Hope someone can explain this to me.

Best regards,

Henning Heiberg-Andersen


dimm...@yahoo.com

unread,
Oct 17, 2006, 3:07:11 AM10/17/06
to
I don't know what is happening.
In my system everything works fine.

small={{30.06,23523},{56. 38,5}};

ListPlot[small, PlotStyle -> PointSize[0.02]]
(*plot to be displayed*)

Jean-Marc Gulliet

unread,
Oct 17, 2006, 3:08:13 AM10/17/06
to
Hi,

Looking at what you posted, I am confident that the values hold by vec
are in string format. You can check that with Map[Head, small, {-1}].
Now you can transform the strings into expressions by using
ToExpression, but beware that your data set seems odd: an entry such as
00005 is going to be converted as 5. However, 56. 38 will become 2128.
since the white space is going to be interpreted as implicit multiplication.

In[1]:=
small={{"30.06","23523"},{"56. 38","00005"}}

Out[1]=
{{30.06,23523},{56. 38,00005}}

In[2]:=
ListPlot[small];

From In[2]:=


Graphics::"gptn":"Coordinate 30.06 in {30.06, 23523} is not a
floating-point number.

In[3]:=
Map[Head,small,{-1}]

Out[3]=
{{String,String},{String,String}}

In[4]:=
small=ToExpression[small]

Out[4]=
{{30.06,23523},{2128.,5}}

In[5]:=
Map[Head,small,{-1}]

Out[5]=
{{Real,Integer},{Real,Integer}}

In[6]:=
ListPlot[small];

Regards,
Jean-Marc

Jens-Peer Kuska

unread,
Oct 17, 2006, 3:13:16 AM10/17/06
to
Hi,

can you tell me how we shall find out what input
produce

| Out[1]:= { {30.06, 23523}, {56. 38,00005}}

because
{56. 38,00005}

is what ??

{56.38, 5}

or
{56.39, "00005"}

??
Regards
Jens

"Henning Heiberg-Andersen"
<henning.hei...@gmail.com> schrieb im
Newsbeitrag news:egvbr1$s16$1...@smc.vnet.net...

ben

unread,
Oct 17, 2006, 3:21:22 AM10/17/06
to
Dear Henning,

Sorry, I did not get your error message.
Is the space in 56. 38 also in your notebook?

Bye
Ben

Henning Heiberg-Andersen schrieb:

Jaccard Florian

unread,
Oct 17, 2006, 3:23:24 AM10/17/06
to
Hello,

If I copy your "small", I don't have any problem...
Maybe your vec is interpreted as text?
Try

ListPlot[ToExpression[small]]

Hope it helps!

Regards

Florian Jaccard


-----Message d'origine-----
De : Henning Heiberg-Andersen [mailto:henning.hei...@gmail.com]
Envoyé : lundi, 16. octobre 2006 08:37
À : math...@smc.vnet.net
Objet : "Not a floating-point number" WHY?

0 new messages