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

savefig appears to miscalculate margins with GR over ssh/without X #2127

Closed
cmcaine opened this issue Aug 6, 2019 · 2 comments
Closed

savefig appears to miscalculate margins with GR over ssh/without X #2127

cmcaine opened this issue Aug 6, 2019 · 2 comments
Labels

Comments

@cmcaine
Copy link

cmcaine commented Aug 6, 2019

Related: #1905

using Plots
savefig(plot(rand(100)), "plot.pdf")

Observe that the left margin is off the page when I run this over ssh (without X)

plotsjl-plot-without-x.pdf
plotsjl-plot-with-x.pdf

Running this before making the plot seems to fix it: ENV["GKSwstype"]="100":

plotsjl-plot-without-x-workaround.pdf

Current error messages when running without X:

Machine 1:

qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS

Machine 2:

.julia/packages/GR/ZI5OE/src/../deps/gr/bin/gksqt: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
Did you start 'gksqt'?

GKS: Open failed in routine OPEN_WS
GKS: GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS

Both are capable of generating plots fine, so these error messages are inappropriate -- should just say it can't find X and shut up.

@cmcaine cmcaine changed the title savefig produces miscalculates margins with GR over ssh/without X savefig appears to miscalculate margins with GR over ssh/without X Aug 6, 2019
@asinghvi17 asinghvi17 added the GR label Aug 13, 2019
@oxinabox
Copy link

oxinabox commented Feb 20, 2021

This doesn't seem to happen on headless Mac or Windows on GHA.
Posssibly bycause they have X (or equiv).

here is examples for

savefig(heatmap([1 0; 0 1]), "plot.pdf")

Headless Linux VM

image

Local Mac Laptop

(identical to Mac / Windows on GHA)
image


Note that GR.jl on its own seems to work fine (using GR.savefig) as does GRUtils.jl

@t-bltg
Copy link
Member

t-bltg commented Nov 13, 2022

I cannot reproduce this on a remote machine on linux. Does it still occur ?

@t-bltg t-bltg closed this as completed Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants