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

Make tickmarks the same length for both axes in GR 2D plots #3659

Merged
merged 4 commits into from
Jul 25, 2021

Conversation

daschw
Copy link
Member

@daschw daschw commented Jul 21, 2021

Avoid too short ticks for one axis in very wide or narrow plots. This changes

plot(rand(10), size=(200, 400))

from
portrait_old

to
portrait_new

and

plot(rand(10), size=(600, 100))

from
wide_old

to
wide_new

@daschw daschw changed the title Gr tickmarks Make tickmarks the same length for both axes in GR 2D plots Jul 21, 2021
@daschw daschw added the GR label Jul 21, 2021
@codecov
Copy link

codecov bot commented Jul 21, 2021

Codecov Report

Merging #3659 (458d72b) into master (0550033) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3659      +/-   ##
==========================================
+ Coverage   63.83%   63.91%   +0.08%     
==========================================
  Files          28       28              
  Lines        6923     6925       +2     
==========================================
+ Hits         4419     4426       +7     
+ Misses       2504     2499       -5     
Impacted Files Coverage Δ
src/axes.jl 85.23% <100.00%> (+0.48%) ⬆️
src/Plots.jl 31.42% <0.00%> (ø)
src/examples.jl 61.76% <0.00%> (ø)
src/animation.jl 38.20% <0.00%> (ø)
src/utils.jl 52.62% <0.00%> (+0.08%) ⬆️
src/recipes.jl 58.21% <0.00%> (+0.22%) ⬆️
src/layouts.jl 68.48% <0.00%> (+0.26%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0550033...458d72b. Read the comment docs.

@BeastyBlacksmith
Copy link
Member

Thats definetly an improvement, I would argue that the ticklength should be the same irrespective of the size of the window.
For example are the ticks on the second figure much longer than on the first

@isentropic
Copy link
Member

Oh my god, this been bothering me since forever. I could never get it fixed myself

Copy link
Member

@isentropic isentropic left a comment

Choose a reason for hiding this comment

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

looks really good to me

@isentropic
Copy link
Member

I actually think it should be like

max(ticksize_x_axis, ticksize_y_axis)

where ticksize_y_axis is the old way of calculating it. So it would scale as before

@daschw
Copy link
Member Author

daschw commented Jul 23, 2021

OK, how about this?
regular
minorticks
portrait_update
wide_update
tiny

@isentropic
Copy link
Member

I think it looks a little to long compared to pyplot, maybe scale down by factor of 1.25 or 1.5?

@isentropic
Copy link
Member

Overall, whatever you decide i support it. This is already much better than before

@daschw
Copy link
Member Author

daschw commented Jul 24, 2021

Thanks for the feedback!
next suggestion:

regular
minorticks
portrait
wide
tiny
big

@isentropic
Copy link
Member

This looks perfect to me.

@t-bltg t-bltg merged commit 86d3097 into JuliaPlots:master Jul 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants