-
Notifications
You must be signed in to change notification settings - Fork 204
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
Extra X-axis padding when there is a label #779
Comments
Actually you can see that with the expected result the Y-axis is also misaligned |
It looks to me like the descents should not be being used in calculating the height of the axis. If I do this diff --git a/axis.go b/axis.go
index 3b275ad..451acce 100644
--- a/axis.go
+++ b/axis.go
@@ -235,7 +235,6 @@ type horizontalAxis struct {
// size returns the height of the axis.
func (a horizontalAxis) size() (h vg.Length) {
if a.Label.Text != "" { // We assume that the label isn't rotated.
- h += a.Label.TextStyle.FontExtents().Descent
h += a.Label.TextStyle.Height(a.Label.Text)
h += a.Label.Padding
} @sbinet WDYT? |
(apologies for the belated answer. with the events unfolding in France, I have a limited bandwith for software...) SGTM. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What are you trying to do?
Create a graph with 0-padded axis and axis names
What did you do?
What did you expect to happen?
What actually happened?
What version of Go and Gonum/plot are you using?
I just fetched gonum 0.13, and im using go 1.22.3 (linux/amd64)
Does this issue reproduce with the current master?
Did not try, but there does not seem to be any real changes in master
The text was updated successfully, but these errors were encountered: