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

multiply legend_font_pointsize by line_width #4530

Merged
merged 3 commits into from
Nov 21, 2022
Merged

Conversation

t-bltg
Copy link
Member

@t-bltg t-bltg commented Nov 20, 2022

Fix #3003.

The inconsistency should be fixed.

Needs new reference images. Maybe we need some non-linearity or flag here to revert to non-scaling of legend line width. TBD.

PR
ref1

master
https://docs.juliaplots.org/dev/gallery/gr/generated/gr-ref1/#gr_demo_1

Copy link
Member

@BeastyBlacksmith BeastyBlacksmith left a comment

Choose a reason for hiding this comment

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

I mean.. I don't like that scaling at all, but being consistent is better than not

@t-bltg
Copy link
Member Author

t-bltg commented Nov 20, 2022

Maybe multiply by min(lw, 5), so that it doesn't get too large in the legend ?
🤔

@t-bltg
Copy link
Member Author

t-bltg commented Nov 21, 2022

I've arbitrarily clamped the legend linewidth in the range [0.2 - 5] (default is lw=1) so that legend boxes with lw outside this range still look acceptable.

It think clamping is required, since we want to avoid legend entries overlap.

What are your thoughts on these values @BeastyBlacksmith ?

using Plots
x = rand(10)
plot(x, lw=0.1)
plot(x, lw=5)
plot(x, lw=10)

lw=0.1
0 1

lw=5
5

lw=10
10

@BeastyBlacksmith
Copy link
Member

Looks reasonable 👍🏻

@codecov
Copy link

codecov bot commented Nov 21, 2022

Codecov Report

Base: 91.08% // Head: 91.09% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (994c44a) compared to base (5fd4d60).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4530   +/-   ##
=======================================
  Coverage   91.08%   91.09%           
=======================================
  Files          40       40           
  Lines        7683     7689    +6     
=======================================
+ Hits         6998     7004    +6     
  Misses        685      685           
Impacted Files Coverage Δ
src/args.jl 84.70% <100.00%> (ø)
src/backends/gr.jl 92.71% <100.00%> (+0.03%) ⬆️

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@t-bltg t-bltg merged commit 96baa69 into JuliaPlots:master Nov 21, 2022
@t-bltg t-bltg deleted the lw branch November 21, 2022 12:03
@syou83syou83
Copy link

Can anybody share an example code how this problem has been solved? I don't quite get it. Thank you very much. @t-bltg @BeastyBlacksmith

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.

[BUG] Inconsitent linewidth in legend
3 participants