GiovineItalia / Gadfly.jl

Crafty statistical graphics for Julia.
http://gadflyjl.org/stable/
Other
1.9k stars 250 forks source link

Title/Label rendering issue with PDF backend (Gadfly v0.7.0) #1177

Open CiaranOMara opened 6 years ago

CiaranOMara commented 6 years ago

I've encountered a PDF rendering issue where text is not positioned correctly (see attached PDFs and their corresponding PNGs for comparison).

array_aesthetics.pdf array_aesthetics

colored_boxplot.pdf colored_boxplot

julia> versioninfo()
Julia Version 0.6.4
Commit 9d11f62bcb (2018-07-09 19:09 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen Threadripper 1950X 16-Core Processor
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Zen MAX_THREADS=16)
  LAPACK: libopenblas
  LIBM: libm
  LLVM: libLLVM-3.9.1 (ORCJIT, generic)
tlnagy commented 6 years ago

Could you provide us with the code to reproduce this?

CiaranOMara commented 6 years ago

These were just two examples pulled from the testscript results of the commit tagged v0.7.0.

tlnagy commented 6 years ago

This is definitely a bug in the PDF backend. Any idea when this was introduced? AFAIK, there hasn't been any changes to text rendering in awhile.

bjarthur commented 6 years ago

easiest to track down with git bisect, just takes time

tlnagy commented 6 years ago

@CiaranOMara what version of Compose are you using? https://github.com/GiovineItalia/Compose.jl/commit/0762a90d77d30fc53b2e37cc92b305d0eb8bf90c introduced some fixes for text extents in Compose.

CiaranOMara commented 6 years ago

I'm on Compose v0.6.0, which is two commits behind GiovineItalia/Compose.jl@0762a90.

julia> Pkg.status("Compose")
 - Compose                       0.6.0

Upgrading Compose to v0.6.1, which includes GiovineItalia/Compose.jl@0762a90.

julia> Pkg.update("Compose")
INFO: Updating METADATA...
INFO: Updating cache of ... <removed for brevity>
INFO: Computing changes...
INFO: Upgrading Compat: v1.0.0 => v1.0.1
INFO: Upgrading Compose: v0.6.0 => v0.6.1
INFO: Upgrading MacroTools: v0.4.2 => v0.4.4
INFO: Upgrading NaNMath: v0.3.1 => v0.3.2
INFO: Upgrading Nullables: v0.0.6 => v0.0.7

Unfortunately, running the Gadfly tests with Compose v0.6.1 still yields the same sort of result.

julia> Pkg.test("Gadfly")

What sort of versions am I expected to have for the binaries?

bjarthur commented 6 years ago

works for me on julia 0.6.3 and master branches of both gadfly and compose

tlnagy commented 6 years ago

Hey @CiaranOMara, can you confirm that you're still seeing this on the latest Compose and Gadfly masters on Julia 1.0?

tlnagy commented 6 years ago

You need to be using the latest masters of both Compose and Gadfly

julia> using Pkg
julia> pkg"add Compose#master"
julia> pkg"add Gadfly#master"
CiaranOMara commented 6 years ago

Sorry, you did say master. I deleted my posts above as they added nothing.

I'm getting the following error with Cairo.

(v1.0) pkg> test Gadfly

.
.
.

[ Info: Loading Cairo backend into Compose.jl
ERROR: LoadError: GitError(Code:ENOTFOUND, Class:Repository, could not find repository from '/home/username/.julia/packages/Gadfly/jzFcg')
Stacktrace:
 [1] GitRepo(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LibGit2/src/error.jl:101
 [2] top-level scope at none:0
 [3] include at ./boot.jl:317 [inlined]
 [4] include_relative(::Module, ::String) at ./loading.jl:1038
 [5] include(::Module, ::String) at ./sysimg.jl:29
 [6] include(::String) at ./client.jl:388
 [7] top-level scope at none:0
in expression starting at /home/username/.julia/packages/Gadfly/jzFcg/test/runtests.jl:10
ERROR: Package Gadfly errored during testing

This error is present for the current release and master of Cairo.


(v1.0) pkg> st
    Status `~/.julia/environments/v1.0/Project.toml`
  [c52e3926] Atom v0.7.6
  [159f3aea] Cairo v0.5.6
  [a81c6b42] Compose v0.6.1+ #master (https://github.com/GiovineItalia/Compose.jl.git)
  [186bb1d3] Fontconfig v0.1.1+ #master (https://github.com/JuliaGraphics/Fontconfig.jl.git)
  [c91e804a] Gadfly v0.8.0+ #master (https://github.com/GiovineItalia/Gadfly.jl.git)
  [e5e0dc1b] Juno v0.5.3

(v1.0) pkg> st
    Status `~/.julia/environments/v1.0/Project.toml`
  [c52e3926] Atom v0.7.6
  [159f3aea] Cairo v0.5.6+ #master (https://github.com/JuliaGraphics/Cairo.jl.git)
  [a81c6b42] Compose v0.6.1+ #master (https://github.com/GiovineItalia/Compose.jl.git)
  [186bb1d3] Fontconfig v0.1.1+ #master (https://github.com/JuliaGraphics/Fontconfig.jl.git)
  [c91e804a] Gadfly v0.8.0+ #master (https://github.com/GiovineItalia/Gadfly.jl.git)
  [e5e0dc1b] Juno v0.5.3

I'm not sure how to tackle this error.

CiaranOMara commented 6 years ago

It seems to be that this error arrises from the fact that packages are not added as git repositories even when using add package_name#branch. However, they are added as repositories to dev with dev package_name.

CiaranOMara commented 6 years ago

With Gadfly under dev, I can run the tests. Unfortunately, the same rendering issues are present for me. Do you think this means there is an issue with an included binary?


(v1.0) pkg> st
    Status `~/.julia/environments/v1.0/Project.toml`
  [c52e3926] Atom v0.7.6
  [159f3aea] Cairo v0.5.6+ #master (https://github.com/JuliaGraphics/Cairo.jl.git)
  [a81c6b42] Compose v0.6.1+ #master (https://github.com/GiovineItalia/Compose.jl.git)
  [186bb1d3] Fontconfig v0.1.1+ #master (https://github.com/JuliaGraphics/Fontconfig.jl.git)
  [c91e804a] Gadfly v0.8.0+ [`~/.julia/dev/Gadfly`]
  [e5e0dc1b] Juno v0.5.3