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

The user should choose the font #49

Closed
oameye opened this issue Oct 3, 2022 · 2 comments · Fixed by #51
Closed

The user should choose the font #49

oameye opened this issue Oct 3, 2022 · 2 comments · Fixed by #51

Comments

@oameye
Copy link
Member

oameye commented Oct 3, 2022

The package should let the use choose the font he wants to use. Otherwise it can cause problem when using HarmonicBalance in practice. For example, I use a lot of unicodes in my variable naming. However, the forced computer modern font does not recognise the unicodes in ploting such that I get plotting results seen in the figure.
image

The solutions would be to not touch the font setting of Plots.jl in the function

function _set_Plots_default()
    font = "Computer Modern"
    default(linewidth=2, legend=:outerright)
    default(fontfamily=font, titlefont=font , tickfont=font)
end
@oameye oameye changed the title The usershould choose the font The user should choose the font Oct 3, 2022
@jkosata
Copy link
Member

jkosata commented Oct 3, 2022

This should be doable via a keyword arguments, these are all passed to Plots.plot
Here `plot(...; titlefont="sans-serif")

Computer Modern is set as default for consistency with the LaTeX labels

@oameye
Copy link
Member Author

oameye commented Oct 3, 2022

Ha but I think you misunderstand the problem. You set computer modern by default for every plot. Also the plots outside the package. So if I first plot via the HarmonicBalance package and afterwards plot a random plot like x = -5:0.1:5; plot(x, x.^2, title = "x₀"), the plot will be in the "computer modern". I think it is better to not touch the default setting over whole Plots.jl. If you want the HarmonicBalance plots to be in "computer modern" you can do it manually in the HarmonicBalance.plot function. In that way, the HarmonicBalance plots are computer modern, but the 'self-made' plots designed by the user during the session are not touched and will be by default in "sans-serif". HarmonicBalance is in that way better designed for further processing data and better compatible with other packges who, for example, plot unicode.

image

tldr: I wouldn't touch the 'Plots.default' function and implement that "computer modern" is the default plot font differently

But it is just a suggestion :p
, one can also just change the default font after it plotted with HarmonicBalance
. I know it is nitpick 😛 , I can try to implement it differently and make a pull request. ( For clarity, "computer modern" stays default font)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants