Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using Fontconfig shrinks plot window relative to axes #1572

Closed
nathanrboyer opened this issue Mar 10, 2022 · 12 comments
Closed

using Fontconfig shrinks plot window relative to axes #1572

nathanrboyer opened this issue Mar 10, 2022 · 12 comments

Comments

@nathanrboyer
Copy link

nathanrboyer commented Mar 10, 2022

This works fine.

julia> using Gadfly
julia> plot(Geom.line, x=1:3, y=1:3)

image

This does not.

julia> using Gadfly, Cairo, Fontconfig
julia> plot(Geom.line, x=1:3, y=1:3)

image

The problem becomes worse for more complex examples. The plot in this discourse thread becomes unreadable, and using draw(PNG("Test.png", 6inch, 4inch), p) just further shrinks the plot.

I get the same output behavior running in Pluto, WSL terminal, and VSCode on Windows 11 using the newest version of all packages:

  • Julia: 1.7.2
  • Gadfly: 1.3.4
  • Cairo: 1.0.5
  • Fontconfig: 0.4.0
@bjarthur
Copy link
Member

by "this does not" work, are you referring to the rotated x-axis labels? if so, try adding Guide.xticks(orientation=:horizontal).

if you're referring to the size of the plot changing, as in the discourse thread, then i'm not sure that's a Gadfly problem per se as if i save the plot to a file and then it looks fine. so pluto / vscode is probably wrapping the HTML in a weird way. see #1561

@nathanrboyer
Copy link
Author

nathanrboyer commented Mar 14, 2022

I am referring to the plot's size and distance from the axis labels. I see the same issue whether I save the plot to a file or view it as html.
Test

@bjarthur
Copy link
Member

i still can't reproduce. me being on Gadfly master and julia 1.7.1 are the only differences. i'm on mac osx.
tried saving to PDF, SVG, PNG, PS and they all look fine.

@nathanrboyer
Copy link
Author

To reiterate, the problem only appears immediately after adding the Fontconfig package.

  • If I only using Gadfly, then I can plot and save to SVG without any issues.
  • using Gadfly, Cairo also behaves normally.
  • using Gadfly, Cairo, Fontconfig produces the weird plot dimensions above no matter where I render or how I save the plots.

I imagine I should raise an issue with Fontconfig.jl, but I don't know what to say is wrong or how it interfaces with Gadfly.

@bjarthur
Copy link
Member

what OS are you using?

@nathanrboyer
Copy link
Author

Windows 11

@montyvesselinov
Copy link

The same problem here!

@nathanrboyer
Copy link
Author

Root cause was found in duplicate issue #1587, so I am closing this one. Temporary workaround is to pin a dependency of Cairo.jl to an older version.

]add Pango_jll
]pin Pango_jll@1.42.4

@montyvesselinov
Copy link

I confirm with additional testing that [email protected] is needed. However, [email protected] and [email protected] fail!

@montyvesselinov
Copy link

I do not think this issue has been resolved.

@montyvesselinov
Copy link

@nathanrboyer have you found a solution to this problem? Other than using on old version of Pango_jll?

@nathanrboyer
Copy link
Author

No, I stopped using Gadfly because of it. I only closed this issue because yours (#1587) is a duplicate, and there should not be two separate issues tracking the same problem. I haven't seen any indication that anyone has worked on this problem; presumably none of the current maintainers use Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants