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

Issue with GR plot in Atom #1727

Closed
rveltz opened this issue Sep 6, 2018 · 19 comments
Closed

Issue with GR plot in Atom #1727

rveltz opened this issue Sep 6, 2018 · 19 comments
Assignees

Comments

@rveltz
Copy link

rveltz commented Sep 6, 2018

Hi,

I would like to plot a layout in Atom. But, if there are too many points, nothing is output. For example, changing (in the following example) 20000 to 200000 outputs nothing in Atom with Julia v0.7, osx.

Is it to be expected?

Thank you for your help.

gr()
        Plots.plot(layout=(3,1))
        Plots.plot!(rand(20000),subplot=1)
        Plots.plot!(rand(20000),subplot=2)
@mkborregaard
Copy link
Member

I actually currently have this issue in the REPL as well.

@sosiristseng
Copy link

I also have this issue. Running Win10 and Julia v1.0. However, savefig() works.

@rveltz
Copy link
Author

rveltz commented Sep 14, 2018

Hi,

Any idea where this might be coming from?

@jheinen
Copy link
Member

jheinen commented Sep 14, 2018

I can even plot Plots.plot!(rand(2000000),subplot=...) - it's probably a question of memory resources in your host environment. Plotting such amounts of data in a reasonable way requires compressing the dataset into much smaller aggregate arrays and display it as an image. This will be supported in the next major GR release.

@rveltz
Copy link
Author

rveltz commented Sep 14, 2018

But it used to work in Atom / julia v0.6.4 ...

@rveltz rveltz closed this as completed Sep 14, 2018
@rveltz rveltz reopened this Sep 14, 2018
@jheinen
Copy link
Member

jheinen commented Sep 14, 2018

Also 0.6.4 works for me with 2000000 points ...

Plots v"0.17.4"
GR v"0.34.1+"
GR run-time "0.34.1.post6"

@mkborregaard
Copy link
Member

Well that shows that the error is in the Plots gr backend, not GR itself.
I wonder if it isn't still the segmentation PR that's increased memory consumption - what do you think @daschw ?

@daschw
Copy link
Member

daschw commented Sep 14, 2018

Well that shows that the error is in the Plots gr backend, not GR itself.

Why? @jheinen used Plots.plot!(rand(2000000),subplot=...) and it worked for him on both, 1.0 and 0.6.4. I don't think we can conclude anything from that.

I wonder if it isn't still the segmentation PR that's increased memory consumption

That was already introduced in Plots 0.17.0 and 0.17.1. Nevertheless, it could still be related. I need to take a closer look, but first I want to finish the docs PRs this weekend.

@rveltz
Copy link
Author

rveltz commented Sep 14, 2018

I see this issue in Atom - Julia v1.0 on OSx.

[28b8d3ca] GR v0.34.1
[91a5bcdd] Plots v0.20.2

not in the REPL.

@daschw
Copy link
Member

daschw commented Sep 14, 2018

I also see it in the REPL.

@mkborregaard
Copy link
Member

Why?

Because he used GR 0.34.1 on both - am I overlooking something?

@rveltz
Copy link
Author

rveltz commented Sep 19, 2018

Does anybody could get his hands on the problem in Atom plotting with GR?

@BioTurboNick
Copy link
Member

I've encountered this issue as well. Plotting large numbers of points works in external REPL but not in Atom.

Was suggested to me to ping @pfitzseb on this.

May be related: unable to create new plot window with gui(), or when Juno's settings disables the plot plane, within Juno.

@jheinen
Copy link
Member

jheinen commented Nov 21, 2018

Plotting large numbers of points or lines using SVG may cause trouble when rendered within a browser, Atom or nteract. For plain GR you should use the new shade function or switch to PNG format.

GR 0.36.0 fixes similar problems with the default output (GKSterm) on macOS.

For Plots.jl I'd recommend to switch to GR 0.36.0, too.

@BioTurboNick
Copy link
Member

I can confirm that with GR 0.36.0 the Juno plot interface works. Can also confirm that switching back to SVG breaks things with Juno again. Too bad, because resizable/zoomable plots are good for inspecting positional point data (e.g. single molecule localization microscopy).

However, I could only get the newest GR version when I switched from the JuliaPro 1.0.1.1 distribution of Julia to a manually downloaded Julia 1.0.2. The former was stuck at 0.34.1 for some reason.

@jheinen
Copy link
Member

jheinen commented Nov 22, 2018

Would be interesting for us to have a concrete example (single molecule localization microscopy). Could you provide a reference to a notebook or Julia script along with the data? Either, the SVG part (in GR) can be further optimized, or, the data can better be displayed using the new shade functions, or we/you have to wait for the new GR output capabilities (e.g. JavaScript widget) to be finished.

@BioTurboNick
Copy link
Member

@jheinen - Sure, I can put something together after the holiday. Perhaps SVG isn't the right answer though; I think it would need to be more like MATLAB where the points stay the same size as you zoom. Unless another backend exists that provides that ability?

We're talking about clusters of points ~100-500 nm in a field ~50 microns across, so being able to zoom in on each one to inspect their structure is helpful, and for comparing the results of filtering/grouping operations on them.

@SimonDanisch
Copy link
Member

i just tried it in Makie, and I can plot more than 10^7 points fluently with zoom etc...
E.g. for your case:

using Makie
scene = scatter(
   rand(Point2f0, 500_000) .* 50000, markersize = 100, 
   color = rand(Float32, 500_000) # could also be a vector of colors directly
)

I'm not sure if you mean stay the same in screen coordinates or stay the same in axis coordinates... The latter is the default in Makie and I think makes the most sense for this kind of exploration!
If you need the first option, it's supposed to work soon via different units and could already be emulated by projecting the markersize with the camera projection matrix ;)
scatter

@jheinen
Copy link
Member

jheinen commented Nov 23, 2018

@jheinen - Sure, I can put something together after the holiday. Perhaps SVG isn't the right answer though; I think it would need to be more like MATLAB where the points stay the same size as you zoom. Unless another backend exists that provides that ability?

We're talking about clusters of points ~100-500 nm in a field ~50 microns across, so being able to zoom in on each one to inspect their structure is helpful, and for comparing the results of filtering/grouping operations on them.

This is exactly what the new shade function in GR provide. You seem to require not just a visual zoom but an aggregation followed by an abstract rendering (as opposed to overplotting) step - that's exactly what the new GR function do.

You can find a detailed description here (in German).

@t-bltg t-bltg closed this as completed Nov 24, 2022
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

8 participants