如何确定哪些字体可用并在朱莉娅图中使用?

发布于 2025-01-23 21:34:50 字数 441 浏览 5 评论 0原文

我需要修改朱莉娅图中的标题,标签和注释。它需要是大胆的,或者是合理的类似。 (不是我的选择。)我尝试使用我在帖子和文档中发现的内容更改字体

plot( title="foobar", titlefont=font(14,"Arial") )

plot( title="foobar", titlefontfamily="Arial" )

但这些字体不起作用。我尝试不同的字体名称,基本上没有任何作用。我通过计算机现代serif和1或2其他的更改。我发现

事情可能会更加困难,因为我在Mac上。我正在使用GR后端的图。我可能会从GR后端切换出来,但很难摆脱地块。

如何在朱莉娅图中找到哪些字体可在我的机器上使用?有没有办法使用GR或其他软件包导入字体?

I need to modify which font is used for titles, labels, and annotations in a Julia plot. It needs to be Arial Bold or something reasonably similar. (Not my choice.) I try to change the font using what I find in posts and documentation like

plot( title="foobar", titlefont=font(14,"Arial") )

or

plot( title="foobar", titlefontfamily="Arial" )

but these do not work. I try different font names and basically nothing works. I get a change with computer modern, serif, and 1 or 2 others. I found this dictionary of GR fonts in the source but, again, most of them don't work although I can get some italic or bold fonts with some combinations.

Things may be more difficult because I am on a mac. I am using Plots with the GR backend. I could possibly switch away from the GR backend but going away from Plots would be difficult.

How do I find out which fonts are available for use in Julia plots and use them on my machine? Is there a way to import fonts with GR or other packages?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

日暮斜阳 2025-01-30 21:34:50

这可能对您有用。

using Plots
x = 0:0.1:2π
y = sin.(x)
plotfonts = Plots.font(40, "Helvetica")
plot(x, y, title="Helvetica 4ever", titlefont = plotfonts)

[“

也许您应该尝试Pyplot。

This might work for you.

using Plots
x = 0:0.1:2π
y = sin.(x)
plotfonts = Plots.font(40, "Helvetica")
plot(x, y, title="Helvetica 4ever", titlefont = plotfonts)

[lplot1

Perhaps you should try PyPlot.

强者自强 2025-01-30 21:34:50

我相信没有这样的参数。
但是,您可以将乳胶格式与图一起使用!

using LaTeXStrings, Plots

plot( title=L"x, y\mathbf{\ this\ is\ in\ bold}\mathrm{\ This\ is\ normal\ text}")

I believe there is no such parameter.
However you can use LaTeX formatting with Plots!

using LaTeXStrings, Plots

plot( title=L"x, y\mathbf{\ this\ is\ in\ bold}\mathrm{\ This\ is\ normal\ text}")

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文