# UnicodePlots examples; Plotly licensing

**URL:** <https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280>\
**Category:** Visualization\
**Created:** [January 4, 2017, 10:33am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280 "2017-01-04T10:33:07Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Post date:** [January 4, 2017, 10:33am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/1 "2017-01-04T10:33:07Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/31):
>
> I just needed a quick histogram, not even a plot,

If it is really only just about having a quick and dirty look from the terminal, then maybe this does the job:

```julia
julia> using UnicodePlots

julia> histogram(randn(1000))
               ┌────────────────────────────────────────┐ 
   (-4.0,-3.0] │ 2 │ 
   (-3.0,-2.0] │▇▇ 20 │ 
   (-2.0,-1.0] │▇▇▇▇▇▇▇▇▇▇▇▇▇ 133 │ 
    (-1.0,0.0] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 346 │ 
     (0.0,1.0] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 338 │ 
     (1.0,2.0] │▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 141 │ 
     (2.0,3.0] │▇▇ 19 │ 
     (3.0,4.0] │ 1 │ 
               └────────────────────────────────────────┘ 

```

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 4, 2017, 10:43am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/2 "2017-01-04T10:43:07Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/32):
>
> If it is really only just about having a quick and dirty look from the terminal, then maybe this does the job:

I knew of it, but it doesn’t handle my case (yet… not complaining, didn’t expect it to; I see however it even has color, that I didn’t expect):

julia\> histogram(rand(Char, 1000))  
ERROR: MethodError: Cannot `convert` an object of type Type{Char} to an object of type AbstractFloat

---

<div class="post-metadata">

**Author:** ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Post date:** [January 4, 2017, 10:50am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/3 "2017-01-04T10:50:53Z")

</div>

What do you expect it to show? Do you treat `Char` as a number? or are you interested in the number of times each character occurs in your vector? In the later case you may be looking for a barplot instead of a histogram

```julia
julia> using UnicodePlots

julia> barplot(StatsBase.countmap(['a','c','a','a','c']))
     ┌────────────────────────────────────────┐ 
   a │▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ 3 │ 
   c │▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ 2 │ 
     └────────────────────────────────────────┘ 

```

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 4, 2017, 11:21am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/4 "2017-01-04T11:21:06Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/34):
>
> are you interested in the number of times […] you may be looking for a barplot instead of a histogram

YES! Thanks. Still should really look into Plots.jl…

`barplot(StatsBase.countmap(map(Char, rand(32:127, 1000))))`

Sorry for draging this out, just answering ot show a minor indenting bug, that is no big deal to me…:

```julia
   i │▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ 9 │ 
    │▪▪▪▪▪▪▪▪▪▪▪▪ 7 │ 
   K │▪▪▪▪▪▪▪▪▪▪▪▪ 7 │ 

```

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 4, 2017, 11:34am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/5 "2017-01-04T11:34:22Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/26):
>
> Ps Plotly isn’t free ? [https://plot.ly/](https://plot.ly/)

Yes (and no…) “Try free edition” implies non-free (as in speech) to me, but here that seems not the case. [Maybe you meant “no-cost” anyway? That also applies.]

I confirmed PlotlyJS (and Plotly that uses it) are under the MIT “Expat” License.

It seems you should have no freedom issues as in PlotlyJS.jl github repo, I also see same MIT for dependency:

[https://raw.githubusercontent.com/sglyon/PlotlyJS.jl/master/deps/plotly-latest.min.js](https://raw.githubusercontent.com/sglyon/PlotlyJS.jl/master/deps/plotly-latest.min.js)

[Good luck with reading that minified code… 🙂 it’s still “free software”; just wouldn’t be “GPL-compatible”… In general that would mean not ok to distribute with GPL… (LGPL would be ok) but “arms-length” probably applies here, and js runs in the browser (another process) so I’m pretty sure you’re ok (at least if your GPL would be in non-browser).]

I didn’t check further (other dependencies), it seems everything running on your machine is free. I’m not sure SaaS applies, if so you might have other concerns with that (see Stallman on that too…)…

Not sure what you’re paying for (optionally) - didn’t check - probably just some optional convenience features.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 4, 2017, 11:47am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/6 "2017-01-04T11:47:47Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/37):
>
> Yes (and no…) “Try free edition” implies non-free (as in speech) to me, but here that seems not the case. [Maybe you meant “no-cost” anyway? That also applies.]

Plots.jl includes Javascript files for it which doesn’t use the cloud service and is free. It builds with Plots.jl, so if you just `plot(...)` without installing a backend, it will open a browser and use Plotly.

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 4, 2017, 11:52am UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/7 "2017-01-04T11:52:24Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/25):
>
> automatically returns, while
> 
> a = 2;
> 
> does not (like MATLAB). However, that would make you have to put ; everywhere in a script

Thanks; this is very useful to know! \*

I didn’t realize e.g. [with UnicodePlots]: `histogram(randn(1000));` # wouldn’t display anything; not too useful, but is e.g. for `big_array=randn(1000);`

Somehow the same doesn’t apply to:

`display(plot(rand(10,10))); # nor display(plot(rand(10,10));)` # not that it matters much - I guess because output goes to non-REPL browser…

- 

```julia
julia> a=2;

julia>

```

still an extra newline (for no good reason); myabe should be fixed to conserve screen space…

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 4, 2017, 12:17pm UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/8 "2017-01-04T12:17:16Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/3):
>
> > vincent:  
> > have a look on the page: [http://julialang.org/downloads/plotting.html](http://julialang.org/downloads/plotting.html)
> 
> That page should have a section on Plots.jl. I’ll submit a PR.

I too a look at the page (assume PR is in); and Vincent’s code:

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/4):
>
> using Plotsplotlyjs(size = (300,300), legend = false)
> 
> plot(rand(10,5)) plot(x = 1:10, y = rand(10))

Neither works; I’m on Ubuntu 16.04, of course with Python [2.7.12] installed. Strange that PyPlot didn’t work to begin with, and (to me), I guess I was asking for Python install here, but not two versions… older python-2.7.11-0 and newer python-2.7.13 (and [more than one?] [mini]conda… and PyPlot still failes after…:

```julia
julia> withenv("PYTHON" => "") do
           Pkg.build("PyPlot")
       end
INFO: Building Conda
INFO: Building PyCall
INFO: No system-wide Python was found; got the following error:
could not spawn `'' -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('VERSION'))"`: no such file or directory (ENOENT)

[..]
INFO: Installing miniconda ...
[..]
installing: _cache-0.0-py27_x0 ...
installing: python-2.7.11-0 ...

[..]
The following packages will be downloaded:

    python-2.7.13 | 0 11.5 MB
[..]
    conda-4.2.13 | py27_0 391 KB

[..]
python-2.7.13

```

[PS. Is it only me, is Discourse slow? Annoyingly, order of letters that I type in, keep appearing in the incorrect order… I guess it’s a general [here: Brave beta w/“load average: 0,11”] browser issue (Chrome derivative; if I recall happened before with it and/or Firefox; what’s the best browser…?)… Happens on other websites, such as Quora (but not in the REPL).]

---

<div class="post-metadata">

**Author:** ![Evizero](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evizero/32/10118_2.png) [@Evizero](https://discourse.julialang.org/u/Evizero)\
**Post date:** [January 4, 2017, 1:08pm UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/9 "2017-01-04T13:08:39Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/37):
>
> [Good luck with reading that minified code… it’s still “free software”; just wouldn’t be “GPL-compatible”… In general that would mean not ok to distribute with GPL… (LGPL would be ok) but “arms-length” probably applies here, and js runs in the browser (another process) so I’m pretty sure you’re ok (at least if your GPL would be in non-browser).]

A minified version is not a fair way to judge readability or make this assertions about plotly.js. (unless I am misunderstanding the point you are trying to make)

Plotly.js is on github and the code is fairly readable

> **[GitHub - plotly/plotly.js: Open-source JavaScript charting library behind...](https://github.com/plotly/plotly.js)**
>
> Open-source JavaScript charting library behind Plotly and Dash - GitHub - plotly/plotly.js: Open-source JavaScript charting library behind Plotly and Dash

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [January 4, 2017, 2:08pm UTC](https://discourse.julialang.org/t/unicodeplots-examples-plotly-licensing/1280/10 "2017-01-04T14:08:12Z")

</div>

> [@How to choose a plotting package?](https://discourse.julialang.org/t/how-to-choose-a-plotting-package/1134/44):
>
> A minified version is not a fair way to judge readability or make this assertions

Yes, about readability, I’ve now added the 🙂 I should have put there. However my main point was the GPL (potential) issue:

[https://www.gnu.org/software/librejs/free-your-javascript.html](https://www.gnu.org/software/librejs/free-your-javascript.html)  
[see:  
“As additional permission under GNU GPL version 3 section 7, you  
may distribute non-source (e.g., minimized or compacted)”

meaning new in GPLv3, and its absense in GPLv2 (and other wording) meaning, considered there binary, ont ok as a source; not allowed to redistribute as such, without “corresponding source”, e.g. the non-minified version). See also e.g. LibreJS.]

> **[Better GPL compliance when using JS minification](https://www.drupal.org/node/1493876)**
>
> By minifying code and removing comments; one might argue that the GPL is not being followed to the letter of the law. By providing a comment in the minified JS pointing to the js source file this should solve most potential issues as a link to the...
