# Problem saving a UnicodePlots figure

**URL:** <https://discourse.julialang.org/t/problem-saving-a-unicodeplots-figure/92522>\
**Category:** Visualization\
**Tags:** plots, unicodeplots\
**Created:** [January 4, 2023, 8:00pm UTC](https://discourse.julialang.org/t/problem-saving-a-unicodeplots-figure/92522 "2023-01-04T20:00:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarawanEmara](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marawanemara/32/43665_2.png) [@MarawanEmara](https://discourse.julialang.org/u/MarawanEmara)\
**Post date:** [January 4, 2023, 8:00pm UTC](https://discourse.julialang.org/t/problem-saving-a-unicodeplots-figure/92522/1 "2023-01-04T20:00:03Z")

</div>

Hello! I have a problem-saving plot formed through UnicodePlots.  
The code I’m using could be found in this [GitHub Repository](https://github.com/LouisBouvier/WarcraftShortestPaths.jl/blob/main/test/tutorial.jl).

Everything works fine, I just wanted to attempt and save one of the plots to try and export it from my GCP VM to my local environment, so I edited the following (lines 117-121):

```julia
#=
We are interested both in the loss and cost ratio between true and computed shortest path.
=#
Gaps = Cost_ratios .- 1
savefig(plot_loss_and_gap(Losses, Gaps, options), export_parth*"fig1.png")

```

and added the following at the top (line 30)

```julia
export_path = joinpath(@ __DIR__ , "..", "export")

```

I then get this error:

```julia
ERROR: LoadError: MethodError: no method matching savefig(::Plots.Plot{Plots.GRBackend}, ::String)
Closest candidates are:
  savefig(::Plot, ::AbstractString; color, kw...) at ~/.julia/packages/UnicodePlots/jcYUt/src/show.jl:545
Stacktrace:
 [1] top-level scope
   @ ~/WarcraftShortestPaths.jl/test/tutorial.jl:123
 [2] include(fname::String)
   @ Base.MainInclude ./client.jl:476
 [3] top-level scope
   @ REPL[3]:1
in expression starting at ~/WarcraftShortestPaths.jl/test/tutorial.jl:123

```

So, my question is, how could I save a figure of type Plots.Plot{Plots.GRBackend}?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![MarawanEmara](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marawanemara/32/43665_2.png) [@MarawanEmara](https://discourse.julialang.org/u/MarawanEmara)\
**Post date:** [January 4, 2023, 8:55pm UTC](https://discourse.julialang.org/t/problem-saving-a-unicodeplots-figure/92522/2 "2023-01-04T20:55:02Z")

</div>

It seems like the solution was simple… I don’t know if it’s necessarily good but I added the following line:

```julia
import Plots.savefig

```
