# Plotting broken? Gadfly and Plots backends not showing axis ticks, can't plot DataFrames

**URL:** https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201
**Category:** General Usage
**Created:** [April 28, 2021, 9:17pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201 "2021-04-28T21:17:59Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![datadreamscorp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datadreamscorp/32/24518_2.png) [@datadreamscorp](https://discourse.julialang.org/u/datadreamscorp)
#### Post date: [April 28, 2021, 9:17pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/1 "2021-04-28T21:17:59Z")

</div>

Opened one of my scripts today to find this error whenever I tried to plot using a DataFrame in Pluto.jl. Tried plotting two vectors in another session and axis ticks are not showing properly (image below), which I guess is part of the problem. Tried plotting in REPL and same thing happened. Had a friend install julia and tried plotting with gadfly, same result. tried doing some quick plots with Plots.jl and Makie, in both cases axis ticks seem to have a problem with showing float values.

Failed to show value:

ArgumentError: embedded NULs are not allowed in C strings: “-\0.\0”

```
unsafe_convert@c.jl:216[inlined]
pango_to_svg(::String)@pango.jl:330
draw(::Compose.SVG, ::Compose.TextPrimitive{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Compose.Rotation{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}, ::Int64)@svg.jl:975
draw(::Compose.SVG, ::Compose.Form{Compose.TextPrimitive{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Compose.Rotation{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}}})@svg.jl:732
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:477
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:509
drawpart(::Compose.SVG, ::Compose.AdhocContainerPromise, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:390
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:509
drawpart(::Compose.SVG, ::Compose.Table, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:390
drawpart(::Compose.SVG, ::Compose.Context, ::Compose.IdentityTransform, ::Compose.UnitBox{Float64, Float64, Float64, Float64}, ::Measures.BoundingBox{Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}, Tuple{Measures.AbsoluteLength, Measures.AbsoluteLength}})@container.jl:509
draw@container.jl:356[inlined]
show(::IOContext{IOBuffer}, ::MIME{Symbol("text/html")}, ::Compose.Context)@Compose.jl:182
show_richest(::IOContext{IOBuffer}, ::Any)@PlutoRunner.jl:640
var"#sprint_withreturned#28"(::IOContext{Base.DevNull}, ::Int64, ::typeof(Main.PlutoRunner.sprint_withreturned), ::Function, ::Compose.Context)@PlutoRunner.jl:579
format_output_default(::Any, ::Any)@PlutoRunner.jl:503
#format_output#17@PlutoRunner.jl:520[inlined]
formatted_result_of(::Base.UUID, ::Bool, ::Nothing)@PlutoRunner.jl:435
top-level scope@none:1

```

 ![Screenshot_20210428_113615](https://global.discourse-cdn.com/julialang/original/3X/d/1/d19184f5880f396eab37e21cde81294a63ae9b6f.png)

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [April 28, 2021, 10:15pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/2 "2021-04-28T22:15:28Z")

</div>

Can you give a full MWE? Is your friend using the same list of packages as you? (i.e. same `Manifest.toml`)

---

<div class="post-metadata">

### Author: ![datadreamscorp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datadreamscorp/32/24518_2.png) [@datadreamscorp](https://discourse.julialang.org/u/datadreamscorp)
#### Post date: [April 28, 2021, 10:20pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/3 "2021-04-28T22:20:24Z")

</div>

> [@pdeffebach](#):
>
> MWE

Thanks for the reply. I am rather new to julia, what is MWE? My friend did a clean julia install on her Mac computer (I’m using linux). She only installed julia 16.1 and used Pkg to install Gadfly, got pretty much the same figure I uploaded

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [April 28, 2021, 10:23pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/4 "2021-04-28T22:23:09Z")

</div>

Huh wow that’s odd. See definition for MWE and other tips for helping us help you [here](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757).

---

<div class="post-metadata">

### Author: ![datadreamscorp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datadreamscorp/32/24518_2.png) [@datadreamscorp](https://discourse.julialang.org/u/datadreamscorp)
#### Post date: [April 28, 2021, 10:49pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/5 "2021-04-28T22:49:30Z")

</div>

Thank you for pointing me there! In this case, the error pops up when just using Gadfly to do even the simplest plot:

```julia
using Gadfly

plot(x=1:10, y=1:10)

```

will output a plot like the one above, straight line of points but the messed up axes ticks.

The error I pasted first appears when trying to plot output from a model I’ve been working on (in the form of a DataFrame). These plots were working perfectly well a couple days ago, too.

Update: In Pluto, I get the error `julia ArgumentError: embedded NULs are not allowed in C strings: "-\0.\0"`

after running

```julia
using Gadfly

plot(x= repeat([1,2,0], 50))

```

but not when running

```julia
using Gadfly

plot(x= repeat([1,2,3], 50))

```

although the axes ticks are still messed up in the second block.

---

<div class="post-metadata">

### Author: ![datadreamscorp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datadreamscorp/32/24518_2.png) [@datadreamscorp](https://discourse.julialang.org/u/datadreamscorp)
#### Post date: [April 29, 2021, 12:15am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/6 "2021-04-29T00:15:50Z")

</div>

This seems to be a problem with julia 1.6.1, I installed 1.5.4 and ran my script, plotting is is working well there.

---

<div class="post-metadata">

### Author: ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)
#### Post date: [April 29, 2021, 5:54am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/7 "2021-04-29T05:54:00Z")

</div>

> [@datadreamscorp](#):
>
> `plot(x= repeat([1,2,0], 50))`

I can reproduce the problem with the ticks on:

```julia
julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.6.0)
  CPU: Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

(jl_vUckHj) pkg> st Gadfly
      Status `/private/var/folders/hq/p78m4kzx65g8mtwq7t7__5j00000gp/T/jl_vUckHj/Project.toml`
  [c91e804a] Gadfly v1.3.2

```

---

<div class="post-metadata">

### Author: ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)
#### Post date: [April 29, 2021, 9:58am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/8 "2021-04-29T09:58:32Z")

</div>

I had the same problem and could fix it by pinning `Grisu.jl` to `v1.0.0 https://github.com/JuliaAttic/Grisu.jl.git#b27b234`. The latest `Grisu` commit broke `Plots/pyplot()` and `Gadfly` in our environment.

---

<div class="post-metadata">

### Author: ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)
#### Post date: [April 29, 2021, 10:14am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/9 "2021-04-29T10:14:07Z")

</div>

I found the same. Via [Showoff.jl](https://github.com/JuliaGraphics/Showoff.jl) 0.3.2:

```julia
julia> using Showoff

julia> showoff([100.0], :auto)
1-element Vector{String}:
 "\x0000"

```

via Showoff 1.0.2:

```julia
julia> using Showoff

julia> showoff([100.0], :auto)
1-element Vector{String}:
 "100"

```

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [April 29, 2021, 10:17am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/10 "2021-04-29T10:17:29Z")

</div>

Change to Grisu has been reverted ([New version: Grisu v1.0.2 by JuliaRegistrator · Pull Request #35627 · JuliaRegistries/General · GitHub](https://github.com/JuliaRegistries/General/pull/35627)).

The bottom line issue is that Showoff.jl uses a lot of the internals of Grisu and should probably be rewritten to use a stable API (not use Grisu at all which was never public).

---

<div class="post-metadata">

### Author: ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)
#### Post date: [April 29, 2021, 10:21am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/11 "2021-04-29T10:21:45Z")

</div>

You probably know way better than me, but is that reversion strictly necessary? Like I said in the previous comment, it does work for me on the newest Showoff. It’s just that Gadfly was still pinned to Showoff 0.3 ([CompatHelper: bump compat for "Showoff" to "1.0" by github-actions[bot] · Pull Request #1522 · GiovineItalia/Gadfly.jl · GitHub](https://github.com/GiovineItalia/Gadfly.jl/pull/1522)).

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [April 29, 2021, 10:22am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/12 "2021-04-29T10:22:29Z")

</div>

Well, people are yelling that the commit broke their plotting so I rather revert first (since the commit was non crucial) and figure out what is going on after. But yeah, I can’t repro on master of Showoff.

---

<div class="post-metadata">

### Author: ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)
#### Post date: [April 29, 2021, 11:17am UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/14 "2021-04-29T11:17:54Z")

</div>

Its quite likely just the Gadfly pin of Showoff which caused all the issues. In the first post of this thread, @datadreamscorp already had Gadfly installed which limited the version of Showoff to 0.3. Then, installing Plots.jl and Makie.jl is possible, but still Showoff will be set to 0.3 because Plots.jl has

```julia
[compat]
...
Showoff = "0.3.1, 1.0"
...

```

---

<div class="post-metadata">

### Author: ![datadreamscorp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datadreamscorp/32/24518_2.png) [@datadreamscorp](https://discourse.julialang.org/u/datadreamscorp)
#### Post date: [April 29, 2021, 7:12pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/15 "2021-04-29T19:12:26Z")

</div>

I am too new to know if this will be useful, but yesterday I did a clean install of 1.6.1 along with Gadfly and the problem persisted. Same with my friend, who didn’t even have julia installed until I asked her to. Have not yet tried 1.6 with the above change to Showoff.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [April 29, 2021, 7:42pm UTC](https://discourse.julialang.org/t/plotting-broken-gadfly-and-plots-backends-not-showing-axis-ticks-cant-plot-dataframes/60201/16 "2021-04-29T19:42:02Z")

</div>

Just do an update from the package manager.
