Graphing in JavaScript
dev.to·13w·
Discuss: DEV

I feel incomplete without a graphing utility.

It probably has something to do with majoring in physics. Visualizing relationships in space – “thinking in graphs” – is a natural way for me to explore a problem or communicate an idea. In Python, things were easy. Matplotlib was more or less the standard graphing library, and was more than sufficient for my purposes. Now that I’m getting a handle on JavaScript, one of my first priorities is to find a native way to accomplish the same thing.

Let’s try recreating a matplotlib graph from an old class project. The premise was to calculate the electric field of a not-quite-spherically symmetric shell of charge, both analytically and computationally, and then compare the results. I’ve slightly edited the code for brevity and clarity, but …

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help