-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
Proposed fix for Latex sub/super-scripts in legends #3598
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
@ptoche, is this approach ok for you ? |
This looks great, thanks for putting this together! :-) |
You can use |
Please see the working example at #3598 (comment).
This alternative also works: using LaTeXStrings
using Random; Random.seed!(1234)
using Plots; gr()
main() = begin
y1, y2 = rand(100), rand(100)
histogram(y1, ylims=(0, 50), label=L"\left\Vert\beta_{1}^{2}-\beta_{2}^{2}\right\Vert")
histogram!(
y2, label=L"\left\Vert\beta_{2}^{2}-\beta_{3}^{2}\right\Vert", legendfontsize=10,
legend_hfactor=1.25, extra_kwargs=:subplot
)
png("foo")
end
main() |
Ok, thanks, so this MWE works:
The extra arguments have to be in the same |
Fixes #3558:
extra_kwargs
mecanism.Discussion:
Change [1.] does modify some reference images, but I think the fix is justified. Only applying [2.] allows fixing the OP issue, without changing the default legend sizes.
MWE
With PR
Without using
extra_kwargs
:Using
:legend_hfactor=>1.25
:Without PR
Default behavior modification (example # 23)
With PR
Without PR