# Easiest way to plot

**URL:** https://swi-prolog.discourse.group/t/easiest-way-to-plot/2498
**Category:** Nice to know
**Created:** [June 11, 2020, 3:51am UTC](https://swi-prolog.discourse.group/t/easiest-way-to-plot/2498 "2020-06-11T03:51:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)
#### Post date: [June 11, 2020, 3:51am UTC](https://swi-prolog.discourse.group/t/easiest-way-to-plot/2498/1 "2020-06-11T03:51:16Z")

</div>

Using this Julia\<-\>Prolog [interface](https://github.com/haldai/Jurassic.pl) I think this is the easiest way to plot data from SWI-Prolog:

```prolog
jl_using("Pkg"). % Only if Plots is
:= 'Pkg'.add("Plots"). % not installed in julia

jl_using("Plots").
y := rand(10).
plt := plot(y, kw(title, "10 Random numbers"), kw(show, true),kw(hover,y)).

```

I wish [Jurassic](https://github.com/haldai/Jurassic.pl) would be turned into a pack for easy installation.

---

<div class="post-metadata">

### Author: ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)
#### Post date: [June 11, 2020, 7:22am UTC](https://swi-prolog.discourse.group/t/easiest-way-to-plot/2498/2 "2020-06-11T07:22:51Z")

</div>

Good alternatives are Nicos’ [real](https://www.swi-prolog.org/pack/list?p=real) package or the _Rserve_ based variant thereof used for SWISH.

---

<div class="post-metadata">

### Author: ![damiazz94](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@damiazz94](https://swi-prolog.discourse.group/u/damiazz94)
#### Post date: [June 11, 2020, 10:06am UTC](https://swi-prolog.discourse.group/t/easiest-way-to-plot/2498/3 "2020-06-11T10:06:47Z")

</div>

There is also a **very experimental** package that plots lines and points using [gnuplot](http://www.gnuplot.info/): [https://github.com/damianoazzolini/plplot](https://github.com/damianoazzolini/plplot)
