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

plotter: implement GlyphBoxer for plotter.Line #762

Merged
merged 1 commit into from Apr 20, 2023

Conversation

sbinet
Copy link
Member

@sbinet sbinet commented Apr 4, 2023

Fixes #761.

Please take a look.

Fixes gonum#761.

Signed-off-by: Sebastien Binet <binet@cern.ch>
@sbinet sbinet requested a review from kortschak April 4, 2023 08:56
@sbinet
Copy link
Member Author

sbinet commented Apr 4, 2023

one existential question: should we create one gigantic glyphbox (or rather 4, one around each of the xmin, xmax, ymin, and ymax points), or one for each of line's points (as is done in this PR) ?

@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.50 🎉

Comparison is base (1cd1f0e) 73.34% compared to head (49a83ba) 74.85%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #762      +/-   ##
==========================================
+ Coverage   73.34%   74.85%   +1.50%     
==========================================
  Files          56       58       +2     
  Lines        5159     7368    +2209     
==========================================
+ Hits         3784     5515    +1731     
- Misses       1191     1657     +466     
- Partials      184      196      +12     
Impacted Files Coverage Δ
plotter/line.go 92.12% <100.00%> (+1.32%) ⬆️

... and 54 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's worth taking a look at how this affects this file when zoomed in.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like, for the green "pre-" step, the outer limit of the steps is now the outer shell of the black line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I've convinced myself it's coming from an hysteresis effect stemming from the original width of the (vertical) line.
it only shows for vertical lines because, in the example, the p.Y.{Min,Max} are fixed and the glyph boxes won't change the data view range in y (as ymax=20 is quite larger than the biggest y value).

the effect is then coming from clipping the x/y-ranges (via padX in plot.go) + (probably) some floating point rounding errors.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, OK.

plotter/line.go Show resolved Hide resolved
@kortschak
Copy link
Member

I think what you have is probably the best approach. I am concerned about the impact on the step plot though. It does weird things to the alignment in ways that I would not expect.

@sbinet sbinet merged commit 192da64 into gonum:master Apr 20, 2023
8 checks passed
@sbinet sbinet deleted the issue-761 branch April 20, 2023 09:35
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

Successfully merging this pull request may close these issues.

plot: Plot renders outside of image bounds
3 participants