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

Set a Data Point Using the New Interactive Mode #515

Open
RoyiAvital opened this issue Apr 29, 2023 · 20 comments
Open

Set a Data Point Using the New Interactive Mode #515

RoyiAvital opened this issue Apr 29, 2023 · 20 comments

Comments

@RoyiAvital
Copy link

Looking at the blog post How to achieve better interactivity with GR I can see the data point:

image

I was wondering if there could be a feature to set them.
Namely I want some points to be displayed constantly.

For instance, on MATLAB I can do the following (From Orthogonal Projection onto the Unit Simplex):

image

On MATALB I can hit Ctrl and make the one displayed permanent and move forward to a new one.

@jheinen
Copy link
Owner

jheinen commented Apr 29, 2023

The edit feature is still WIP.

@IngoMeyer441
Copy link
Contributor

I think what we could implement next week is to show multiple data points at once. This should only require a few changes.

@RoyiAvital
Copy link
Author

By the way, will those data point work on images as well?

@IngoMeyer441
Copy link
Contributor

By the way, will those data point work on images as well?

Yes, they work on these GR plot types:

  • line
  • scatter
  • stem
  • step
  • heatmap
  • marginalheatmap
  • contour
  • contourf
  • imshow
  • pie
  • hexbin
  • shade
  • quiver

On MATALB I can hit Ctrl and make the one displayed permanent and move forward to a new one.

Do you really use Ctrl? Regarding the MATLAB documentation, the Shift key can be used for this:

Click a plotted data point. To create multiple data tips, hold the Shift key as you select data points. To move a data tip to another data point, drag the point where the data tip is located.

@IngoMeyer441
Copy link
Contributor

Starting with release v0.72.5, multiple tooltips can be shown when holding the Alt key (option key on macOS). Pressing the shift key shows all y values for the current x value in a combined tooltip.

@RoyiAvital
Copy link
Author

Is it available using Plots.jl or only directly using GR.jl?

I think you fixed one of the most important issues in the plotting eco system.
I really missed this feature from MATLAB.

@IngoMeyer441
Copy link
Contributor

IngoMeyer441 commented May 18, 2023

This is only available in GR.jl with the plot display:

ENV["GRDISPLAY"] = "plot"
using GR

@RoyiAvital
Copy link
Author

@IngoMeyer441 , I am trying the new plot display on Windows.
Yet nothing pops. It opens a new CMD window yet nothing happens.

@IngoMeyer441
Copy link
Contributor

@RoyiAvital Could you describe, which steps you executed? Hopefully, I can reproduce your problem.

Yet nothing pops. It opens a new CMD window yet nothing happens.

So you don't get any plotting window or is this related to non-existing tooltips?

@RoyiAvital
Copy link
Author

Nothing shows up at all.

@IngoMeyer441
Copy link
Contributor

image

Ok, I get the same broken behavior on Windows 11 with Julia 1.9.2 and latest GR.jl 😞

@IngoMeyer441
Copy link
Contributor

On a second try, I get a plot window:

image

When starting grplot for the first time, the Windows firewall blocked the internal TCP traffic and asked for permissions. This probably caused a timing problem. Did the Windows firewall dialog also show up for you @RoyiAvital?

@RoyiAvital
Copy link
Author

@IngoMeyer441 ,

This is what I typed:

julia> ENV["GRDISPLAY"] = "plot"
"plot"

julia> using GR;

julia> plot(1:10)

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

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

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

No figure or anything appeared.
Nothing about Windows' Firewall.

What's AppName to allow it in the Firewall?

@RoyiAvital
Copy link
Author

OK,
Now I have something strange.

I closed Julia and started new session:

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

A CMD window appeared.
After a second a plot window appeared.
I could see the new labels when walking on the data (With Shift I could see all data points at the given x).

I closed the plot window. The CMD closed as well.
I entered plot(randn(20,5), labels=("a", "b", "c", "d", "e")) again.
This time nothing happens. Also for trying again and again,

So the first plot in a session works.
But nothing after that.

@IngoMeyer441
Copy link
Contributor

@jheinen AFAIK, it is intended behavior, that new plots after closing grplot do not open a new window, isn't it?

@RoyiAvital
Copy link
Author

@IngoMeyer441 , Why?
Also, Does it mean only single figure can be seen at a time?

@IngoMeyer441
Copy link
Contributor

Yes, currently, a new figure overwrites an older figure in the grplot window. Maybe, we should discuss, if this is a good default behavior or if it should at least be possible to change this behavior (for example with an environment variable).

@jheinen
Copy link
Owner

jheinen commented Jul 9, 2023

One could imagine leaving "frozen" versions of figures on the screen - but without interaction. With that you could at least compare figures.

To support multiple plots with full interaction would also require extensive changes in Plots.jl.

@RoyiAvital
Copy link
Author

@jheinen , What about multiple plots with interaction with GRUtils.jl?

@jheinen
Copy link
Owner

jheinen commented Jul 11, 2023

We will discuss that in our group. If full interaction is desired, however, this would be a very extensive expansion that we cannot implement in the short term.

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