# Plotting on Server

**URL:** <https://discourse.julialang.org/t/plotting-on-server/13869>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [August 22, 2018, 4:03am UTC](https://discourse.julialang.org/t/plotting-on-server/13869 "2018-08-22T04:03:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rakeshvar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rakeshvar/32/3613_2.png) [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Post date:** [August 22, 2018, 4:03am UTC](https://discourse.julialang.org/t/plotting-on-server/13869/1 "2018-08-22T04:03:36Z")

</div>

I am trying to install and run `julia 0.6.4` on a cluster at school. (Firstly I had to specify package directory away from my home folder in `\scratch` to accomodate the 5GB.) Then I installed `Plots.jl` and `Plotly.jl`. However when I try to display or save the plots, I am getting the following errors.

```julia
using Plots
Plots.backend() # Plots.PlotlyBackend()
plt = plot(1:9, cumsum(rand(0:9, 9)))
# Gives
# Error showing value of type Plots.Plot{Plots.PlotlyBackend}:
# ERROR: could not spawn `xdg-open /tmp/juliafDEpPG.html`: no such file or directory (ENOENT)

```

I realize that `xdg-open` is not on the cluster but the file `/tmp/juliafDEpPG.html` is on the cluster. When I copy it to local firefox does not show anything. I guess because the file says: `<script src="file:///scratch/users/rakesh/dotjulia/v0.6/Plots/deps/plotly-latest.min.js"></script>` When I make it point to my local installation of `Plotly` it works. Or when I `savefig(plt, 'name.html')`, it works! **So that’s ok.**

But the following fail

```julia
julia> savefig(plt, "tmp1.png")
ERROR: MethodError: no method matching _show(::IOStream, ::MIME{Symbol("image/png")}, ::Plots.Plot{Plots.PlotlyBackend})
Closest candidates are:
  _show(::IO, ::MIME{Symbol("image/png")}, ::Plots.Plot{Plots.PyPlotBackend}) at /scratch/users/rakesha/dotjulia/v0.6/Plots/src/backends/pyplot.jl:1359
  _show(::IO, ::MIME{Symbol("text/html")}, ::Plots.Plot{Plots.PlotlyBackend}) at /scratch/users/rakesha/dotjulia/v0.6/Plots/src/backends/plotly.jl:932
  _show(::IO, ::MIME{Symbol("image/png")}, ::Plots.Plot{Plots.PlotlyJSBackend}) at /scratch/users/rakesha/dotjulia/v0.6/Plots/src/backends/plotlyjs.jl:105

```

I get similar errors for `.svg`, `.pdf`. How do I fix that?  
Thanks.

---

<div class="post-metadata">

**Author:** ![adamslc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adamslc/32/3452_2.png) [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Post date:** [August 22, 2018, 3:16pm UTC](https://discourse.julialang.org/t/plotting-on-server/13869/2 "2018-08-22T15:16:05Z")

</div>

It looks like `Plotly.jl` doesn’t support saving figures as a png. You should try another [backend](http://docs.juliaplots.org/latest/backends/) and see if that fixes the problem.

---

<div class="post-metadata">

**Author:** ![rakeshvar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rakeshvar/32/3613_2.png) [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Post date:** [August 22, 2018, 7:37pm UTC](https://discourse.julialang.org/t/plotting-on-server/13869/3 "2018-08-22T19:37:30Z")

</div>

The website [Output · Plots](http://docs.juliaplots.org/latest/output/#savefig-format) seems to say it does support.
