-
-
Notifications
You must be signed in to change notification settings - Fork 312
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 bar_labels
: LaTeXString
s and fontsize
#2501
Conversation
That's how it looks now let
fig = Figure()
lab1 = L"a - b"
lab2 = L"\frac{a}{b} - \sqrt{b}"
barplot(fig[1,1], [1, 2], [0.5, 0.2], bar_labels = [lab1, lab1], flip_labels_at = 0.3, direction=:x)
barplot(fig[1,2], [1, 2], [0.5, 0.2], bar_labels = [lab1, lab1], flip_labels_at = 0.3)
barplot(fig[2,1], [1, 2], [0.5, 0.2], bar_labels = [lab2, lab2], flip_labels_at = 0.3, direction=:x)
barplot(fig[2,2], [1, 2], [0.5, 0.2], bar_labels = [lab2, lab2], flip_labels_at = 0.3)
text(fig[1,3], [1], [1]; text = [lab2], align = [(-1, 1)])
fig
save("/tmp/fig.png", fig); run(`open /tmp/fig.png`)
end
|
Somehow Makie is rendering the line at the incorrect position. I spent some time on it but couldn't quite understand this drawing pipeline and were the problem could come from. Due to how it looks, I suspect it has something to do with scaling of the lines at some point. |
I narrowed down the offender: it's the Screen.Recording.2022-12-15.at.14.32.42.mov |
Aren't you demonstrating in your video that it's offset and not align? :) I assume the code that updates the linesegments is not hooked up to that observable. It will probably correct with a jump when you change for example the align after you've introduced a gap via offset. |
No, it doesn't. I am not using observables there. The plot is completely redrawn at each slider change. Screen.Recording.2022-12-15.at.14.42.34.mov |
Ok then offset is just completely ignored for linesegments calculation :) Yeah it's missing in this argument list: https://github.com/MakieOrg/Makie.jl/blob/master/src/basic_recipes/text.jl#L87 |
Thanks for the hint! Let's see if I manage to digest all these abbreviations. |
Would you mind if I leave this bug for someone else to fix? I think this PR is already a strict improvement, and the ignored |
Sure! |
Does this need a reference test? |
friendly bump - is there something I can do do help getting this merged? |
Ah, yeah a reference test would be nice if it's not too much work ;) |
alignment use `align` keyword again use `get_xshift` once more fix
Thank you! |
Unfortunately this doesn't work yet because
doesn't work.
Here's an example