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

Feature request : Zoom, pan #40

Open
grero opened this issue Sep 22, 2016 · 25 comments
Open

Feature request : Zoom, pan #40

grero opened this issue Sep 22, 2016 · 25 comments

Comments

@grero
Copy link

grero commented Sep 22, 2016

GR is a great package, especially with respect to plotting speed. In the past I have used Gadly with the GTKInteract package, which allows me to zoom/pan around my plots. I'm sure these features are on the road map for GR as well, so this is just me registering my interest in those features. Keep up the good work!

@ufechner7
Copy link

This is really the main issue stopping me to us GR (with Julia). I also could not find the source code of GKS QtTerm. Is it open source?

@ufechner7
Copy link

Any update on this? Where is the source code of GKS QtTerm?

@FlorianRhiem
Copy link
Contributor

FlorianRhiem commented Mar 28, 2019

I don't know the current status of the work on QtTerm, but you can find the source code of gksqt in the GR runtime repository: https://github.com/sciapp/gr/tree/master/lib/gks/qt

@otobrzo
Copy link

otobrzo commented Dec 19, 2019

I have seen an interactivity in Jupyter demonstrated at the Josef Twitter. I am looking forward to see it soon here, christmas are approaching:-)

@mauro3
Copy link

mauro3 commented May 16, 2023

This is now possible (albeit not yet via the Plots.jl interface): https://forem.julialang.org/jheinen/gr-going-interactive--4dnj

$ GRDISPLAY=plot juliap
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.9.0 (2023-05-07)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using GR

julia> plot(randn(20,5), labels=("a", "b", "c", "d", "e"))

@ufechner7
Copy link

Well, it does not work for me, using Julia 1.9.0 on Ubuntu 22.04.

I don't get an error message, but no plot window appears...

@jheinen
Copy link
Owner

jheinen commented May 17, 2023

Well, it does not work for me, using Julia 1.9.0 on Ubuntu 22.04.

I don't get an error message, but no plot window appears...

Are you using GR v0.72.4 and ist the window title "GR Plot"?

@ufechner7
Copy link

(GR) pkg> st
Status ~/repos/GR/Project.toml
[28b8d3ca] GR v0.72.4 https://github.com/jheinen/GR.jl.git#master

@ufechner7
Copy link

julia> ENV["GRDISPLAY"]="plot"
"plot"
julia> using GR
julia> plot(randn(20,5), labels=("a", "b", "c", "d", "e"))

(GR) pkg> st
Status `~/repos/GR/Project.toml`
  [28b8d3ca] GR v0.72.4
(GR) pkg> 

And without window not window title...

@jheinen
Copy link
Owner

jheinen commented May 17, 2023

... and you are on the command line without any GKS_WSTYPE settings?

@ufechner7
Copy link

Yes, on in the REPL...

@jheinen
Copy link
Owner

jheinen commented May 18, 2023

Could you please update GR.jl (0.72.5) and enable debugging:

JULIA_DEBUG=GR GRDISPLAY=plot julia
using GR
plot(randn(20,5), labels=("a", "b", "c", "d", "e"))

@ufechner7
Copy link

ufechner7 commented May 18, 2023

With this version zoom and pan worked!

But only a few seconds. Then I got:

julia> using GR

julia> plot(randn(20,5), labels=("a", "b", "c", "d", "e"))
┌ Debug: Found GRDISPLAY in ENV
│   display_name[] = "plot"
└ @ GR ~/.julia/packages/GR/SiORT/src/GR.jl:325
┌ Debug: Default GKS_ENCODING
│   ENV["GKS_ENCODING"] = "utf8"
└ @ GR ~/.julia/packages/GR/SiORT/src/GR.jl:362

julia> Segmentation fault (core dumped)

@jheinen
Copy link
Owner

jheinen commented May 21, 2023

I can't reproduce the problem with the run-time version we provide. The problem seems to occur only with the GR_JLL version - so it is hard for me to debug this. I will have to build my own JLL binaries with debugging enabled.

@jheinen
Copy link
Owner

jheinen commented May 23, 2023

The problem should be fixed with 0.72.6

@jheinen jheinen closed this as completed May 23, 2023
@ufechner7
Copy link

ufechner7 commented May 23, 2023

You closed this issue a bit too fast.

It works now fine if I start Julia with:

JULIA_DEBUG=GR GRDISPLAY=plot julia

Thanks a lot for the good work! :)

But it does NOT work if I start Julia with:

GRDISPLAY=plot julia

In this case I get the error message:

julia> include("plot.jl")
cannot connect to host localhost port 8002: 

Content of plot.jl:

using GR
plot(randn(20,5), labels=("a", "b", "c", "d", "e"))

Will you re-open this bug, or shall I create a new bug?

@jheinen jheinen reopened this May 23, 2023
@jheinen
Copy link
Owner

jheinen commented May 23, 2023

It seems to me, that grplot is not stopped correctly when using the GR_JLL version on Linux. This doesn't happen with "our" GR distribution. As a workaround, you might killall grplot. That is not a solution, of course.

I'm trying to find a way to actually exit grplot so that the required socket can be reconnected in a following session.

Maybe it has to do with the overlong LD_LIBRARY_PATH (> 5k characters) - I don't know.

@jheinen
Copy link
Owner

jheinen commented May 25, 2023

@ufechner7 : With GR 0.72.7 this issue should be fixed - it was a timing problem that essentially occurred on Linux systems with more recent kernels. On our test machines the problem did not occur anymore.

Once the version is registered, it would be nice if you could try again.

@ufechner7
Copy link

First it was working for me, now it doesn't. I will try to figure out why.

@ufechner7
Copy link

What is working:

using GR
sleep(1)
plot(rand(20,5))

This even works if put into a file and executed repeatedly.

But if I close the GR window and include the file above again no new window pops up.

If I quit Julia, restart it with

GRDISPLAY=plot julia --project

and include the file above it works again.

The sleep command is not needed.

Summary:
It works the first time, but if you close the GR window it will not pop up again, unless you close the Julia REPL session
and restart Julia.

@jheinen
Copy link
Owner

jheinen commented May 26, 2023

It works the first time, but if you close the GR window it will not pop up again, unless you close the Julia REPL session and restart Julia.

This is the expected behaviour. Closing the window (or leaving Julia) will stop the grplot background process - it's only started once.

@ufechner7
Copy link

But that makes this feature pretty useless... And it is not the way the normal GR windows behave...

@jheinen
Copy link
Owner

jheinen commented May 26, 2023

I don't quite understand why you should stop the grplot process. Or is it just to minimize the window?

Due to performance reasons it makes sense that the process is started only once and runs during the whole Julia session. Since GR is also used in other environments (C, Python, Ruby), we unfortunately do not have arbitrary design options here.

If it is only about minimizing the window, this should be feasible.

@ufechner7
Copy link

Well, my workflow is that I open plot_a, look at it, close it, look at plot_b, close it change some parameters, look at plot_a again...
I don't want to restart Julia in between. I just want to be able to close plots I am currently not interested in. I don't stop the grplot process on purpose, I just close the plot window.

Perhaps you could catch the "click on close icon" event end hide the window instead of closing it?

@ufechner7
Copy link

And it would be nice to be able to open a new window each time you display a plot. I like the way PythonPlot works, I can have multiple plots on the screen and compare them. Plots.jl has the "reuse=false" option for that. Unluckily this is currently only supported by PythonPlot as far as I know.

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

6 participants