-
Notifications
You must be signed in to change notification settings - Fork 41
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
Plot label customisation widget #1920 #2096
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.
- There still seems to be no control over the axis size (i.e. x/yticks)
- The box for the weights is a bit too small to show the weights (at least on my machine, but there are general issues with how things are scaled sometimes)
Added checkbox for applying style to tick labels. Modified list of styles to correspond to 4.x Cleaned up UI elements a bit
Fixed both 1. and 2. |
As changes had been merged to main, built & tested locally on W10/x64. The only customizations that seem to work are changing the text string, changing the font size, and changing the font colour. Changing the font, or the weighting, or applying the style to the axis numbers does not seem to do anything? P.S. I'm building against MPL 2.2.3... |
Matplotlib has the options for different fonts but when you use latex strings (as the default labels are), it uses the latex styling. If you want a different font in latex parts of the label, you'll have to use latex tags e.g. \mathbf for bold. I don't think a system that would make this work, for example by modify the latex string, would work very well without giving SasView a deep understanding of latex. This would be a huge project. And doing it differently would be confusing for people who are used to matplotlib. I would suggest that this is as good as it gets, and this difference is something that will have to be accepted as part of the move to matplotlib. |
To add to Lucas' note - it seems that 4.x behaves in the same way - if label is a non-Latex string, it will modify it accordingly, but will skip it entirely for |
Fair enough. Then should we remove the font & weighting dropdowns? |
We could, but then the user would miss a way to modify the tick labels, which usually are not latex strings. |
The reason why you generally don't want pure latex labels is that the
kerning is different between latex math mode and normal text.
Optimally, labels should be a mixture of latex and plain text. otherwise:
[image: image.png]
…On Mon, Jun 20, 2022 at 8:13 PM Piotr Rozyczko ***@***.***> wrote:
We could, but then the user would miss a way to modify the tick labels,
which usually are not latex strings.
Also, often the axis labels are just text?
—
Reply to this email directly, view it on GitHub
<#2096 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACKU4SUKLAJQAAC3UGPO6YLVQC7HLANCNFSM5ZB2RRSA>
.
You are receiving this because you commented.Message ID:
***@***.***>
--
Dr Lucas Wilkins
+44 (0) 7505 915 726
Personal Website: http://www.lucaswilkins.com/
Alternate e-mail: ***@***.***
|
We probably want to be able to change the title fonts too though.
On Mon, Jun 20, 2022 at 9:45 PM Lucas Wilkins ***@***.***>
wrote:
… The reason why you generally don't want pure latex labels is that the
kerning is different between latex math mode and normal text.
Optimally, labels should be a mixture of latex and plain text. otherwise:
[image: image.png]
On Mon, Jun 20, 2022 at 8:13 PM Piotr Rozyczko ***@***.***>
wrote:
> We could, but then the user would miss a way to modify the tick labels,
> which usually are not latex strings.
> Also, often the axis labels are just text?
>
> —
> Reply to this email directly, view it on GitHub
> <#2096 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ACKU4SUKLAJQAAC3UGPO6YLVQC7HLANCNFSM5ZB2RRSA>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
--
Dr Lucas Wilkins
+44 (0) 7505 915 726
Personal Website: http://www.lucaswilkins.com/
Alternate e-mail: ***@***.***
--
Dr Lucas Wilkins
+44 (0) 7505 915 726
Personal Website: http://www.lucaswilkins.com/
Alternate e-mail: ***@***.***
|
Added a widget allowing for plot label customisation.
The widget is available from the context menu of any SasView plot as "Customize Labels", between "Toggle Legend" and "Change Scale"