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

Improve default values for spaces around ticks, ticks label and axis label ? #211

Open
lpatiny opened this issue Jan 6, 2022 · 1 comment

Comments

@lpatiny
Copy link
Contributor

lpatiny commented Jan 6, 2022

Just wondering what should be the default space between tick labels and axis label. Currently I find it too small and I think we should have couple of pixel space by default so that out of the box the plots look ok.

The space between the tick and tick label could also be a little bit bigger by default (at least on the horizontal axis).

I was looking to matplotlib as an example.

image

There are 5 pixels between the tick and the tick label and around 8 between the tick label and the axis label for the horizontal axis.

For the vertical axis there are 5 pixels between tick and tick label and 10 pixels between tick label and axis label

image

Actually using the current implementation I don't see how to increase those values and add more space around ticks label, axis label or also between title and subtitle.

@wadjih-bencheikh18
Copy link
Member

@lpatiny
i worked on removing hard coded values
but i only made tickLength personalised by the user

about these values
image

red : textOffset = 0; (in Horizontal/vertical axis)
https://github.com/zakodium/react-plot/blob/7327b6f07bd42ccc71d79c8d3e2d5c133fdfdb29/src/components/Axis/HorizontalAxis.tsx#L39

green : we can change directly the 0
https://github.com/zakodium/react-plot/blob/7327b6f07bd42ccc71d79c8d3e2d5c133fdfdb29/src/components/Axis/HorizontalAxisLabel.tsx#L16

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

2 participants