问题描述
源于这个关于线条粗细和点大小设置的问题 [例如PointSize[Large}
, PointSize[0.5]
), 我想知道是否可以改变 PointSize[]
, Thickness[]
等以相对的方式?
Arising from this question regarding line thickness and point size setting [e.g. PointSize[Large}
, PointSize[0.5]
), I was wondering if it is feasible to change PointSize[]
, Thickness[]
etc in a relative manner?
即为什么 PointSize[Larger]
不起作用?或者有可能以某种方式查询现有的点大小,也许可以做类似PointSize[1.25*GetPointSize[]]
的事情(如果像GetPointSize[]"这样的东西存在,我一直无法弄清楚,既不是快速查看文档,也不是快速逆向工程查看 PointSize[x])
I.e. why is it that PointSize[Larger]
doesn't work? Or is possible to somehow query the existing pointsize and perhaps do something likePointSize[1.25*GetPointSize[]]
(I haven't been able to figure this out if something like "GetPointSize[]" exists, neither with a quick look at the documentation, nor from a quick reverse-engineering look at PointSize[x])
推荐答案
您可以使用 PointSize 的 Style 选项形式并在值中使用 Inherited 来完成此操作:
You can do this using the Style option form of PointSize with Inherited in the value:
Graphics[{Style[{Point[{0, 0}],
Style[{Point[{.2, 0}],
Style[{Point[{.4, 0}],
Style[{Point[{.6, 0}],
Style[{Point[{.8, 0}]}, PointSize -> .9 Inherited]},
PointSize -> .9 Inherited]}, PointSize -> .9 Inherited]},
PointSize -> .9 Inherited]}, PointSize -> .1]}, PlotRange -> 1]
这篇关于在 mathematica 中可以对 PointSize[]、Thickness[] 进行相对大小更改吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!