jheinen / GR.jl

Plotting for Julia based on GR, a framework for visualisation applications
Other
356 stars 76 forks source link

plotting generates a blank window #124

Open dav2017 opened 6 years ago

dav2017 commented 6 years ago

Something changed in the past weeks. When I plot data, now I get a blank window opens displaying no plot (but no error at REPL prompt). I tried different plot commands (plot, histogram), eg.:

using  GR
histogram(randn(1000)

I am running GR v. 0.31.0 and Julia v. 0.6.3 on Debian GNU/Linux.

jheinen commented 6 years ago

What's the output of the GR version() command?

dav2017 commented 6 years ago

GR.version() returns "0.31.0".

A further information: I experienced the problem both using GR directly and as a backend of Plots (while Plots+pyplot is working as expected).

jheinen commented 6 years ago

Is the "blank" window a QtTerm? @FlorianRhiem : Can you reproduce this behaviour?

In any case, could please you try to:

ENV["GRDIR"]=""
Pkg.build("GR")
dav2017 commented 6 years ago

The window is named GKS QtTerm. After executing

ENV["GRDIR"]=""
Pkg.build("GR")

nothing changed (I closed and reopened the REPL and tried to plot something).

jheinen commented 6 years ago

... but you can create figures etc, right?

savefig("hist.pdf")
dav2017 commented 6 years ago

Yes, savefig properly generates files (with graph drawn in them).

dav2017 commented 6 years ago

Also, if I use GR within the Jupyter notebook the plot is correctly displayed.

dav2017 commented 6 years ago

I did some more checking. The problem seems related to tiling window managers (dwm, i3): the window is blank if it is opened in tiled mode (and after that no window reshaping or making it float can make it usable for plotting). Instead, if the window is opened as a floating window it properly display the graph (and if I move to tiling mode it keeps working). In the past it used not to be like that, I do not know what changed now, if my window manager configuration or the Qt term.

jheinen commented 6 years ago

Thanks for your hints. I will check this next week when I have access to a Debian machine - I'm currently on a conference.

korantir commented 6 years ago

Same problem with Win10, Atom 1.28.2, GR v. 0.31.0 and Julia 0.6.3, everything run properly, but no plotting in Atom Plots window. Was good week ago. Seems like something changed with latest atom releases, but i'm not sure because latest atom patch changed nothing about plotting at all.

jheinen commented 6 years ago

Works fine for me with macOS 10.14, Atom 1.28.2, GR master and Julia 0.6.4. Do you have a chance to test it on a Mac?

atom

jheinen commented 6 years ago

@dav2017 : unfortunately, I don't have access to a Debian box with a tiling WM. Will have to setup a VM for it ...

korantir commented 6 years ago

Well, I tried all rebuilds etc. Installed julia 0.6.4. All these methods didn't help. Although, for now I have error from issue nearby: "GKS: svgplugin.dll: can't load library, error 126 (0x7e)" and previous solution does not help. BTW on another win machine with latest atom, gr and julia 0.6.0 everything work properly. Sooo I'm quite sure that it is only my problem with GKS/GR build. I'll try to figure it out myself. Thanks for your quick answers @jheinen And for all your work too P.S. Sadly I have no Mac.

jheinen commented 6 years ago

Could you please enter a command window (cmd.exe), change to the directory to where svgplugin.dll is located (..\GR.jl\deps\gr\bin) and invoke the following command:

dumpbin /dependents svgplugin.dll

screen shot 2018-07-19 at 12 17 06

korantir commented 6 years ago

cmd_2018-07-19_15-34-17 I have feeling that something with path is wrong, but i don't have enough time to check code

for now path to svgplugin.dll is C:\Users\Administrator.julia\v0.6\GR\deps\gr\bin

where Administrator is cyrillic, hope it doesn't matter.

dumps look equal for us

pkofod commented 6 years ago

https://discourse.julialang.org/t/precompiling-plots-jl-fails-on-julia-1-0/13232/25

could this be related? read the last part of the discussion

DoktorMike commented 6 years ago

I'm the one who posted that question, and I'm also on a tiling WM (i3wm) on Ubuntu 17.10. I will try to run it using GNOME and see if it works there.

==EDIT== I can confirm that Plots and GR works on my machine when in Gnome. Thus for me it is an issue with my tiling window manager. I have no idea why though.

RaulDurand commented 6 years ago

I can confirm that Plots and GR works on my machine when in Gnome. Thus for me it is an issue with my tiling window manager. I have no idea why though.

Same problem here with i3wm

dav2017 commented 6 years ago

For i3wm (and dwm) a work-around is to open GR plot windows in floating mode. You can edit the i3 "config" file to automatically open these windows as floating. Add this line to the config file (which in Debian is in ~/.config/i3/): for_window [class="gksqt"] floating enable which works both for GR and gr() via Plots.

c42f commented 6 years ago

The for_window workaround worked for me (on ubuntu 18.04 + i3wm). Some observations:

The lib/gks/demo application from GR itself shows the same blank window behavior without the for_window workaround, so this is unlikely related to GR.jl itself, this is probably a GR + tiling WM issue.

With GR.jl:

If the floating GR window is sent to the tiled layer, the plot resizes correctly. However, new plots in the tiled window are the size of the original floating window and the remaining part of the tiled window is not redrawn.

Also

  1. If the for_window workaround is enabled
  2. GR is started and a plot created
  3. the for_window workaround is disabled
  4. subsequent plots in now automatically tiled windows work ok.
ctkelley commented 5 years ago

I am having the same problem on a Mac with Julia 1.1. Everything was fine until I tried to use PlotlyJS.

jheinen commented 5 years ago

I have no idea why a PlotlyJS installation should affect GR. So simple things like:

using  GR
histogram(randn(1000))

are no longer working after you added PlotlyJS?

ctkelley commented 5 years ago

I did a reinstall from scratch and the problem went away.

floswald commented 3 years ago

I'm still with this problem on Mac OS. I rebuilt GR several times. thanks for any help!

➜  ~ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using GR

julia> version()
"0.55.0.post5"

julia> histogram(randn(100))

julia> versioninfo()
Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, haswell)
Environment:
  JULIA_EDITOR = sublime

julia> 
Screenshot 2021-03-03 at 10 46 26
floswald commented 3 years ago

what's really weird is that in VScode that works totally fine.

Screenshot 2021-03-03 at 10 53 50