Plotting help

32 views
Skip to first unread message

Kevin Goldstein

unread,
Feb 15, 2023, 10:59:20 AM2/15/23
to Glowscript Users
I'm trying to write some simple code to show a plot of Mechanical Energy, Potential Energy and Kinetic energy.  For starters, I've just at a ball going up and down.
works as expected.

The problem is that when add the option fast=False  on line 13 (see https://trinket.io/library/trinkets/2864ebab2f) I get the error:

Cannot read properties of undefined (reading 'type') At or near line 26: Pot.plot(ball.pos.y,V)

Any suggestions on what I might be doing wrong?


Bruce Sherwood

unread,
Feb 15, 2023, 7:25:30 PM2/15/23
to Glowscript Users
You're not doing anything wrong. By an extraordinary coincidence, this afternoon I was working on a very similar program and encountered the very same problem. There is a bug that fast=False fails in the presence of dot=True. Apparently you and I are the first people to try this combination (or others never reported it).

Bruce

Kevin Goldstein

unread,
Feb 16, 2023, 1:29:53 AM2/16/23
to glowscri...@googlegroups.com
Thanks Bruce 
That is very helpful - I thought I was making some obscure error with data typing - one of the things I enjoy about Python is that one usually doesn't have to worry about data types. 

I tried to get around the bug by removing the dot=True option independently plotting a moving dot using an additional gdots() plot  (see https://trinket.io/library/trinkets/2864ebab2f)
The same bug appears when one sets fast=False

cheers
Kevin


On Thu, 16 Feb 2023 at 02:25, Bruce Sherwood <bruce.s...@gmail.com> wrote:
You're not doing anything wrong. By an extraordinary coincidence, this afternoon I was working on a very similar program and encountered the very same problem. There is a bug that fast=False fails in the presence of dot=True. Apparently you and I are the first people to try this combination (or others never reported it).

Bruce

--

---
You received this message because you are subscribed to a topic in the Google Groups "Glowscript Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/glowscript-users/F4nMnAKuaGw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to glowscript-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/glowscript-users/7b2689ff-ff44-4e45-8eb1-a937bcd6d33cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages