this post was submitted on 21 Oct 2023
2 points (100.0% liked)

Emacs

305 readers
1 users here now

A community for the timeless and infinitely powerful editor. Want to see what Emacs is capable of?!

Get Emacs

Rules

  1. Posts should be emacs related
  2. Be kind please
  3. Yes, we already know: Google results for "emacs" and "vi" link to each other. We good.

Emacs Resources

Emacs Tutorials

Useful Emacs configuration files and distributions

Quick pain-saver tip

founded 1 year ago
MODERATORS
 

I tried gnuplot and amazed by its performance. It allows you to directly plot mathematical formulas into graphs with just one single line of math equation.

#+BEGIN_SRC gnuplot :file images/trigon01.png
plot [-10:10] sin(x),atan(x),cos(atan(x))
#+END_SRC

https://preview.redd.it/bmp9izl57kvb1.png?width=640&format=png&auto=webp&s=3c13ffc06a7f3b196b2a71067b9aa8d6d048b2e0

when set arguments, it might requires one more line:

#+BEGIN_SRC gnuplot :file images/sd01.png
g(x) = exp(-0.5*(x/s)**2)/s
plot s=1 g(x), s=2 g(x), s=3 g(x)
#+END_SRC

https://preview.redd.it/efjvennd7kvb1.png?width=640&format=png&auto=webp&s=50cbd91d566721af5a95cd9737c2ee9ac79786e2

I feel frustrated, how I wish could acquainted with such a tool a decade ago while grappling with the challenges of visualizing mathematical formulas.

top 8 comments
sorted by: hot top controversial new old
[–] yantar92@alien.top 2 points 11 months ago (1 children)

Also, check out https://archive.org/details/gnuplotinactionu0000jane (Gnuplot in action : understanding data with graphs)

[–] AbstProcDo@alien.top 1 points 11 months ago

great book ,thank you.

[–] dacydergoth@alien.top 1 points 11 months ago

Not only is there an emacs mode for it, there is a whole TeXmacs emacs-a-like for mathematics

[–] kp61dude@alien.top 1 points 11 months ago

Use an org-table with your plots and you aren’t getting any work done for a week!

[–] pathemata@alien.top 1 points 11 months ago (2 children)

nowadays, I don't see why anyone would use gnuplot instead of matplotlib.

[–] nakuaga@alien.top 1 points 11 months ago

Because I already know it well and I don't have the time / want to put myself learning matplotlib or other plotting tools.

[–] AbstProcDo@alien.top 1 points 11 months ago

One could run gnuplot in mind to draw a graph with very limited lines, but impossible to get such a job done with large amount of matplotlib's code.

[–] bloopernova@programming.dev 1 points 11 months ago

Oh this is really cool, and reminds me that I'm not using org-babel nearly enough.