-
Notifications
You must be signed in to change notification settings - Fork 37
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
idea: hplot band-gradients #701
Comments
thanks for your interest in hplot. I must admit I am not completely sold on the idea of a gradient for the band use case (as I don't really see the physics analysis use case - but, admittedly, I haven't done any serious physics analysis in a very long time). looking around a bit, I've noticed these 2 implementations of a gradient:
both revolve around implementing a gradient as a type that implements so I guess it boils down to the minute details on how to describe/model a gradient and the mechanics on how to translate that into an what do you think? |
Hello! Okay, yeah so after digging a bit deeper and understanding what's actually happening here, I think the cleanest approach is implement something like a type UpDownGradient struct {
// Points representing the upper and lower
// bounding lines of the gradient, they must
// have the same range.
UpperPts []vg.Point
LowerPts []vg.Point
// LineStyle is the style of the line around the edge
// of the gradient.
draw.LineStyle
// Upper and Lower colors of the gradient
ColorUpper color.Color
ColorLower color.Color
} Now, I of course want access to something like the So do you think implementing |
interesting paper. I think it would be better to get the ball rolling on the gonum/plot side first. (and regroup here if that doesn't pan out). WDYT? |
ok, I've filed gonum/plot#625 wrt the gradient issue. |
It would be incredible to be able to not only display a color between two bands, but also display a gradient between two bands, potentially with checkpoint colours along the way.
This would be really cool to use in conjunction with percentile data, imagine the scatter plot here https://github.com/go-hep/hep/blob/master/hplot/testdata/s2d_band_golden.png except with a gradient line for the 10th, 25th, 50th, 75th, and 90th percentiles. It could lead to conveying a new level of richness of information of a dataset.
This idea is already somewhat possible with just using multiple bands, but one would need many many solid bands to get the real feel of a gradient and would be kind of cumbersome to implement on the user side. This being said, maybe the most straightforward way to implement this gradient feature within hplot is to simply linearly approximate a large number of tiny bands and associated colors between the provided
Gradient.bands
and plot them as bands with no conour borders, I'm sure with enough bands it would create that gradient feel. (or maybe there is an easier way, again just an idea)Just an idea! Would be open to contributing to its development if there is interest here!
The text was updated successfully, but these errors were encountered: