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

Default settings with white borders can hide points in dense plots #1262

Open
AlexRobson opened this issue Mar 20, 2019 · 5 comments
Open

Default settings with white borders can hide points in dense plots #1262

AlexRobson opened this issue Mar 20, 2019 · 5 comments
Milestone

Comments

@AlexRobson
Copy link

AlexRobson commented Mar 20, 2019

Having just switched to experimenting with Gadfly, I was confused by the apparent behaviour in decreasing opacity of the plots as the number of points became more dense.

Essentially, this would produce something expected:
plot(y=sort(rand(100,)))

where this would produce a barely visible image:

plot(y=sort(rand(1000,)))

This appears to be a related issue: #618

After understanding the issue, something like the above can be plotted like this:
plot(y=sort(rand(1000,)), Geom.point, Theme(highlight_width=0.0mm))

however ideally this, or some equivalent,
would be the default behaviour to avoid confusion in cases such as this.

@Mattriks
Copy link
Member

Mattriks commented Mar 20, 2019

In your plot above, the Theme(discrete_highlight_color= ) default is a function that returns white: the changing opacity is an illusion. Try adding Theme(discrete_highlight_color=identity). And see this example.

The alpha functionality in that example is new: http://gadflyjl.org/dev/gallery/scales/.
You can use it now by doing add Gadfly#master.

@bjarthur bjarthur added this to the 2.0 milestone Mar 22, 2019
@bjarthur
Copy link
Member

making a change like this would be breaking and would require a major version number bump. not that that should stop us, but we do want to be careful about breaking people's plots.

also, usually when the number of points plotted gets so high that this is a problem, it's an indication that one should be using a different geometry. like a density or contour plot for example.

i've added the 2.0 milestone so we can think about this further as the time approaches. thanks for the feedback!

@tlnagy
Copy link
Member

tlnagy commented Mar 22, 2019

AFAIK, we're one of the only plotting libraries that has the default white border approach.

also, usually when the number of points plotted gets so high that this is a problem, it's an indication that one should be using a different geometry. like a density or contour plot for example.

This is my thought as well.

@Mattriks
Copy link
Member

Mattriks commented Mar 22, 2019

Perhaps a community poll?
Here are some suggestions (which users can test):

  1. Theme(discrete_highlight_color=c->"white")
  2. Theme(discrete_highlight_color=c->nothing)
  3. Theme(discrete_highlight_color=identity)
  4. Other suggestions?

Probably better to do a poll via Julia discourse. We should agree here on the possible choices first!

@AlexRobson
Copy link
Author

AlexRobson commented Mar 23, 2019

For context, in my case, it was in exploring some time-series data of length O(1000). Regarding the comment on using different geometries, I don't doubt that that in my case there may be better representations of the data [I've switched to using Gadfly pretty recently, and I'm still understanding the different semantics]. My issue in this case was down to some brief initial confusion on why this behaviour was occuring. Still, it seems that this could be encountered by others similarly new to the package, especially for time-series type data, so fwiw from me a change to the defaults would be welcome (at least, discussed out for a future milestone), potentially more in line with the other plotting libraries, so that behaviour is a bit more expected while starting off with the package.

Thanks for your responses! :)

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

4 participants