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
get_item_rect_size for plot annotations? #2302
Comments
Absolutely yes. Also, all paddings and spacings can be hardcoded based off what values you specify in the themes or what defaults the theme has. See |
Thanks, that works great! By the way - if you don't mind me throwing in another annotation-related question - if I want annotations without the boxes (so, the text part colored, the box transparent), is there any way of making the text colored? I've found that if I set the box to be completely transparent, the text is white, which mostly works for me. But being able to make the text the same color as its line series would be awesome. |
If you specify the background color as (0, 0, 0, 0) - the last zero is important here - ImPlot should be using the color |
Thanks! But I'm confused - what do you mean by binding the theme to add_line_series? Annotations belong to the plot, right? Can they be part of a line series? (Which would be super useful, as my annotations belong to different line series and I'd like them to be the same color as their plots to keep things clear) |
Oh, yes, annotations can only belong to the plot. That said, you can only assign a single
Have you added |
If you really need it you might try overlaying multiple plots, each having a single |
Is your feature request related to a problem? Please describe.
I'm trying to distribute a large amount of plot annotations dynamically in such a way that they don't overlap - and for that, I need the pixel sizes of the annotations. However, get_item_rect_size gives me a KeyError: 'rect_size', as the item_state dict is just {'ok': True, 'pos': [0, 0]}.
Describe the solution you'd like
Would be great to have get_item_rect_size working for annotations.
Describe alternatives you've considered
Is it possible to get the character heights/widths from the font textures directly? I assume those textures are saved somewhere explicitly, but I have no idea how to get them.
The text was updated successfully, but these errors were encountered: