Julia: 带有非常大标题的绘图

huangapple go评论63阅读模式
英文:

Julia: plot with a really large title

问题

我必须制作一个带有长标题的图表,但文字溢出图片而不是分成两三行。我该如何避免这种文字溢出。

英文:

I have to make a plot with a long title but the words overflow from the picture instead of breaking into two or three lines. How can I avoid this text overflow.

using LinearAlgebra
x = y = range(-3, stop = 3, length = 100)
surface(x, y, (x, y) -> sinc(norm([x, y])), title="A very long title with a lot of simple words none of them are really large")

Julia: 带有非常大标题的绘图

答案1

得分: 0

using LinearAlgebra
using Plots
gr()
x = y = range(-3, stop = 3, length = 100)
surface(x, y, (x, y) -> sinc(norm([x, y])), title="一个非常长的标题,其中包含很多简单的词,没有一个词是真正的大词")

Julia: 带有非常大标题的绘图

in case you are using plotly and plotlyjs, you need to use the html line break argument <br>

using LinearAlgebra
using Plots
plotlyjs()
x = y = range(-3, stop = 3, length = 100)
surface(x, y, (x, y) -> sinc(norm([x, y])), title="一个非常长的标题,其中包含<br>很多简单的词,没有一个词是真正的大词")

Julia: 带有非常大标题的绘图

英文:
using LinearAlgebra
using Plots
gr()
x = y = range(-3, stop = 3, length = 100)
surface(x, y, (x, y) -&gt; sinc(norm([x, y])), title=&quot;A very long title with \na lot of simple words none of them \nare really large&quot;)

Julia: 带有非常大标题的绘图

in case you are using plotly and plotlyjs, you need to use the html line break argument &lt;br&gt;

using LinearAlgebra
using Plots
plotlyjs()
x = y = range(-3, stop = 3, length = 100)
surface(x, y, (x, y) -&gt; sinc(norm([x, y])), title=&quot;A very long title with &lt;br&gt;a lot of simple words none of them &lt;br&gt;are really large&quot;)

Julia: 带有非常大标题的绘图

huangapple
  • 本文由 发表于 2023年5月15日 08:48:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76250262.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定