# Error using UnicodePlots

**URL:** <https://discourse.julialang.org/t/error-using-unicodeplots/96751>\
**Category:** General Usage\
**Tags:** unicodeplots\
**Created:** [March 29, 2023, 4:20am UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751 "2023-03-29T04:20:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JosieG](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josieg/32/36221_2.png) [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Post date:** [March 29, 2023, 4:20am UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/1 "2023-03-29T04:20:33Z")

</div>

I got this warning message from “using UnicodePlots” :

> WARNING: using UnicodePlots.xlabel! in module Main conflicts with an existing identifier.

And when I do the following code, what can I get is not a real plot:

```julia
  unicodeplots()
    plt = plot(x, y)
    display(plt)

```

It only returns `Plot{Plots.UnicodePlotsBackend() n=3}`

Is there anyway to get a real plot?

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 29, 2023, 12:06pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/2 "2023-03-29T12:06:26Z")

</div>

Seems that you are loading more than one plotting package at once (`Plots` and `UnicodePlots`). I don’t know where the `unicodeplots()` command you posted there comes from, but if you really need `Plots` to be loaded there, then `import UnicodePlots` instead of `using` and qualify the function calls:

```julia
julia> using Plots # not used here

julia> import UnicodePlots

julia> plt = UnicodePlots.lineplot(rand(10),rand(10))
       ┌────────────────────────────────────────┐ 
   0.9 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⢉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⢸⡆⠀⠉⠢⢄⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⡿⡀⠀⠀⠀⠉⠒⡄⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⢇⢣⠀⠀⠀⠀⡜⠀⠀⠀│ 
       │⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⢸⠀⢇⠀⠀⡰⠁⠀⠀⠀│ 
       │⠀⣀⣑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠘⡄⠸⡄⢠⠃⠀⠀⠀⠀│ 
       │⠀⠀⠈⠉⠛⠻⠶⣦⡤⢄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⡇⠀⢱⡇⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠉⠫⢖⠚⠭⢕⣒⠢⠤⢄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⢱⠀⡎⢳⡀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠒⢄⡀⠉⠑⠒⠤⢌⣉⠑⠒⠢⠤⢄⣀⡀⡇⠀⠀⢸⡜⠀⠈⣧⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⢄⡀⠀⠀⠀⠉⠑⠒⠤⢄⣀⡈⡏⠑⠒⠢⠥⢄⣀⡘⣧⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠈⢹⠒⠢⠤⣀⡀⠀⠈⢹⠃⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠤⡀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠈⠉⠒⠢⠇⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
     0 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠺⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
       └────────────────────────────────────────┘ 
       ⠀0⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀1⠀ 

julia> display(plt)
       ┌────────────────────────────────────────┐ 
   0.9 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⢉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⢸⡆⠀⠉⠢⢄⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⡿⡀⠀⠀⠀⠉⠒⡄⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⢇⢣⠀⠀⠀⠀⡜⠀⠀⠀│ 
       │⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⢸⠀⢇⠀⠀⡰⠁⠀⠀⠀│ 
       │⠀⣀⣑⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠘⡄⠸⡄⢠⠃⠀⠀⠀⠀│ 
       │⠀⠀⠈⠉⠛⠻⠶⣦⡤⢄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⡇⠀⢱⡇⠀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠉⠫⢖⠚⠭⢕⣒⠢⠤⢄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⡇⠀⠀⢱⠀⡎⢳⡀⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠒⢄⡀⠉⠑⠒⠤⢌⣉⠑⠒⠢⠤⢄⣀⡀⡇⠀⠀⢸⡜⠀⠈⣧⠀⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⢄⡀⠀⠀⠀⠉⠑⠒⠤⢄⣀⡈⡏⠑⠒⠢⠥⢄⣀⡘⣧⠀⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠤⡀⠀⠀⠀⠀⠀⠀⠈⢹⠒⠢⠤⣀⡀⠀⠈⢹⠃⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠤⡀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠈⠉⠒⠢⠇⠀⠀│ 
       │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠢⣀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
     0 │⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠺⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀│ 
       └────────────────────────────────────────┘ 
       ⠀0⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀1⠀

```

(you may not need `Plots` at all there, then just `using UnicodePlots` and the direct calls to its functions should work - but `plot` is not one of its functions, it is `lineplot` instead).

---

<div class="post-metadata">

**Author:** ![JosieG](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josieg/32/36221_2.png) [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Post date:** [March 29, 2023, 1:49pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/3 "2023-03-29T13:49:19Z")

</div>

I’m trying to reproduce your result, but I got such plot.

 ![Screen Shot 2023-03-29 at 9.48.35 AM](https://global.discourse-cdn.com/julialang/original/3X/d/3/d3d597f6309dfd850534aab37f0fab1cea76b8c7.png)

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [March 29, 2023, 2:41pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/4 "2023-03-29T14:41:36Z")

</div>

Ah, you are using a notebook. Probably then you should not use unicodeplots at all. Just use:

```julia
using Plots
plt = plot(rand(10),rand(10))
display(plt)

```

---

<div class="post-metadata">

**Author:** ![JosieG](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josieg/32/36221_2.png) [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Post date:** [March 29, 2023, 4:31pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/5 "2023-03-29T16:31:09Z")

</div>

I have changed it to vscode, but I got new error that “Warning: \_display is not defined for this backend.”, do you mind telling me which editor are you using?

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [March 29, 2023, 4:56pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/6 "2023-03-29T16:56:18Z")

</div>

> [@lmiq](#):
>
> I don’t know where the `unicodeplots()` command you posted there comes from, but if you really need `Plots` to be loaded there, then `import UnicodePlots` instead of `using` and qualify the function calls:

This is the command to activate the `unicodeplots` backend from within `Plots`.

@JosieG, you don’t need `using UnicodePlots` if your are using `Plots`:

```julia
using Plots
unicodeplots()
plot(1:2)

```

should suffice.

For the fonts issue on windows, see [GitHub - JuliaPlots/UnicodePlots.jl: Unicode-based scientific plotting for working in the terminal](https://github.com/JuliaPlots/UnicodePlots.jl#known-issues) or [https://github.com/JuliaPlots/UnicodePlots.jl/search?q=font&type=issues](https://github.com/JuliaPlots/UnicodePlots.jl/search?q=font&type=issues).

If your font doesn’t support braille patterns, you can fallback to using ASCII characters:

```julia
using Plots
unicodeplots()
plot(1:2; extra_kwargs=Dict(:subplot=>(; canvas=:dot, border=:ascii)))
plot(1:2, extra_kwargs=Dict(:subplot=>(; canvas=:ascii, border=:ascii))) # alternative canvas
```

---

<div class="post-metadata">

**Author:** ![JosieG](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josieg/32/36221_2.png) [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Post date:** [March 29, 2023, 5:02pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/7 "2023-03-29T17:02:00Z")

</div>

Thanks for your reply. I have tried

```julia
using Plots
unicodeplots()
plot(1:2)

```

in jupyter notebook, but still got `Plot{Plots.UnicodePlotsBackend() n=1}`  
And I tried it in vscode, then I got `Warning: _display is not defined for this backend.` And no plot shows up.  
Even I tried the code below in vscode

```julia
using Plots
unicodeplots()
plot(1:2; extra_kwargs=Dict(:subplot=>(; canvas=:dot, border=:ascii)))
plot(1:2, extra_kwargs=Dict(:subplot=>(; canvas=:ascii, border=:ascii))) # alternative canvas

```

I can still only get Warning: \_display is not defined for this backend.

---

<div class="post-metadata">

**Author:** ![t-bltg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/t-bltg/32/25526_2.png) [@t-bltg](https://discourse.julialang.org/u/t-bltg)\
**Post date:** [March 29, 2023, 5:16pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/8 "2023-03-29T17:16:07Z")

</div>

Can you try explicitly call `display` on the plot object ?

```julia
using Plots
unicodeplots()
p = plot(1:2);
display(p)
gui(p) # alternatively

```

---

<div class="post-metadata">

**Author:** ![JosieG](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josieg/32/36221_2.png) [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Post date:** [March 31, 2023, 6:34pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751/9 "2023-03-31T18:34:40Z")

</div>

Still warning: Warning: \_display is not defined for this backend.
