emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Hendy <jw.hendy@gmail.com>
To: "Garreau, Alexandre" <galex-713@galex-713.eu>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Org-plot/org-babel-gnuplot not working
Date: Mon, 3 Nov 2014 21:48:31 -0600	[thread overview]
Message-ID: <CA+M2ft83HKyaj-XDMwO=VSFJaBHGQCUq-SvW2Gi6w0OQBwxJew@mail.gmail.com> (raw)
In-Reply-To: <28zyuwzzzzzz.0pg.xxuns.g6.gal@galex-713.eu>

[-- Attachment #1: Type: text/plain, Size: 2280 bytes --]

Greetings,


Just took a look at the worg page and gave it a whirl in the style of
Org 8.x. Indeed, the babel/setup section is oudated, and I'm not sure
if 7.9.3f is on the "old style" or new style. I thought there was a
sort of "pre-8.0" version of Org that still adhered to the newer
syntax. In any case, take a look at the attached .org file with my
minimal setup which works successfully for me. Hopefully it's
self-explanatory. I attached my pdf export as well.

I was going to update worg while I was at it... but it seems to be
down for me, at least intermittently. Very odd, as
downforeveryoneorjustme.com says orgmode.org is up... but I can't ping
it and get webpage not available in both Chrome and Firefox??

In any case, hopefully this gets you going and I'll update the worg page.

Please note the section about gnuplot.el. Perhaps at one time this
needed to be downloaded from somewhere else. It shipped with my linux
package, and I downloaded gnuplot right from their site, which also
contains gnuplot.el, so you should be all set as long as you have
gnuplot installed/in your path (try going `$ gnuplot --version` from a
terminal) and copy gnuplot.el to one of your load-path locations.
Redundant to put that in the email as it's in the attached, but for
skimmers who aren't going to download I thought I'd say it twice :)


Best regards,
John

On Mon, Nov 3, 2014 at 7:44 PM, Garreau, Alexandre
<galex-713@galex-713.eu> wrote:
> Hello, when I do `org-plot/gnuplot' on a org-plot figure it says
> “org-plot/gnuplot: Cannot open load file: gnuplot”.
>
> I also tried org-babel-gnuplot, and on an example code, C-c C-c says
> “org-babel-execute-src-block: No org-babel-execute function for
> gnuplot!”.
>
> I’m under Debian Testing (Jessy), have version "GNU Emacs 24.3.1
> (i586-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-09-07 on babin,
> modified by Debian", with Org version 7.9.3f, I’ve installed gnuplot-x11
> package via distro, then gnuplot-mode via distro *and* elpa, then org-babel
> via ELPA (not found in distro), and I put some come in my init.el to
> activate gnuplot, according this:
> <http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-gnuplot.html>.
>
> What could be the cause?

[-- Attachment #2: gnuplot-test.org --]
[-- Type: application/octet-stream, Size: 1762 bytes --]


* setup

- Created the following (saved to =~/Desktop/gnuplot-test/min-config=)

#+begin_src min-config

(add-to-list 'load-path "~/.elisp/org.git/lisp/")
;;(add-to-list 'load-path "~/.elisp/org.git/contrib/lisp")
(add-to-list 'load-path "~/.elisp/site-lisp")

(org-babel-do-load-languages
 'org-babel-load-languages
 '((gnuplot . t)))

#+end_src

- installed gnuplot (Arch linux repo)
- the pkg shipped with a =/usr/share/emacs/site-lisp/gnuplot.el=
  - I downloaded gnuplot-4.6.6 from the official site; it alco contains gnuplot.el
  - I don't think downloading it elsewhere is necessary[fn:1]
- copied this file to =~/.elisp/site-lisp= (which is in load-path above)

Ran this file as follows:
- =$ emacs -Q=
- =M-x load-file RET ~/Desktop/gnuplot-test/min-config=
- =C-x C-f ~/Desktop/gnuplot-test/gnuplot-test.org=
- Tried both on the contents in the next headling:
  - =C-c C-c= on each block, checking .png output
  - =C-c C-e l p= to export to Latex, which also worked

That's it!


* a couple tests

table:

#+tblname: data-table
| x | y1 | y2 |
|---+----+----|
| 0 |  3 |  6 |
| 1 |  4 |  7 |
| 2 |  5 |  8 |


plot code

#+begin_src gnuplot :var data=data-table :export both :file table.png
reset

plot data u 1:2 w lines lw 2 title 'Data Set 1'

#+end_src

#+RESULTS:
[[file:table.png]]


#+begin_src gnuplot :exports both :file functions.png
reset

set title "Putting it All Together"

set xlabel "X"
set xrange [-8:8]
set xtics -8,2,8


set ylabel "Y"
set yrange [-20:70]
set ytics -20,10,70

f(x) = x**2
g(x) = x**3
h(x) = 10*sqrt(abs(x))

plot f(x) w lp lw 1, g(x) w p lw 2, h(x) w l lw 3
#+end_src

#+RESULTS:
[[file:functions.png]]

* Footnotes

[fn:1] For example, googling "gnuplot.el" led me to https://github.com/bruceravel/gnuplot-mode/



[-- Attachment #3: gnuplot-test.pdf --]
[-- Type: application/pdf, Size: 164780 bytes --]

  parent reply	other threads:[~2014-11-04  3:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-04  1:44 Org-plot/org-babel-gnuplot not working Garreau, Alexandre
2014-11-04  2:47 ` John Hendy
2014-11-04  3:48 ` John Hendy [this message]
2014-11-05  0:33   ` Garreau, Alexandre
2014-11-05  0:42     ` John Hendy
2014-11-05  0:57       ` Garreau, Alexandre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+M2ft83HKyaj-XDMwO=VSFJaBHGQCUq-SvW2Gi6w0OQBwxJew@mail.gmail.com' \
    --to=jw.hendy@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=galex-713@galex-713.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).