如何从 Mathematica 的自动标记列表中指定特定的绘图标记?
Mathematica 有十个基本绘图标记,在使用 PlotMarkers->Automatic
制作 ListPlot
时循环使用。圆形、正方形、菱形、上三角形和下三角形有实心和空心版本。第 11 个标记重复填充圆圈,但颜色不同。例如,
ListPlot[Table[{i, i + #}, {i, 1, 7}] & /@ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11},绘图标记 ->自动]
给出
是否可以从这组默认标记中指定特定的绘图标记?上图的 FullForm
显示 Mathematic 使用这些符号的字体,即
Style["\[FilledCircle]", Rule[FontSize, 8.96
]]
`手动设置,但我想知道是否有一种方法可以使用 ColorData[1][n]
从默认绘图颜色中进行选择,其中 n
是第 n 种颜色。
Mathematica has ten basic plot markers which are used cyclically when making a ListPlot
with PlotMarkers->Automatic
. There are filled and empty versions of circle, square, diamond, up triangle, and down triangle. The eleventh marker repeats filled circle, but in a different color. For example,
ListPlot[Table[{i, i + #}, {i, 1, 7}] & /@ {0, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11}, PlotMarkers -> Automatic]
gives
Is it possible to specify a particular plot marker from this set of default markers? The FullForm
of the above plot shows that Mathematic uses fonts for those symbols, i.e.
Style["\[FilledCircle]", Rule[FontSize, 8.96
]]`
which one could set by hand, but I'm wondering if there is a way to do this in the way that one can pick from the default plot colors using ColorData[1][n]
, where n
is the nth color.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
拥有您想要的信息,尽管这些信息没有记录并且可能会发生变化。
has the information you want, although it's very undocumented and subject to change.
如果您使用 GUI 界面,还请注意,您可以从排版面板中选择这些字符,有些甚至有键盘快捷键,例如
ESC fci ESC
或ESC fsq ESC
分别用于实心圆形和正方形。 (在 Mathematica 9 中测试)If you are using the GUI interface, also note that you can select these characters from the Typesetting Palette, and some even have keyboard shortcuts, e.g.
ESC fci ESC
orESC fsq ESC
for filled circles and squares, respectively. (Tested in Mathematica 9)Mathematica 中的内置符号可用于定义一组符号并按照您喜欢的顺序使用它们。
{filledcircle、filledsquare、filleddiamond、filleduptriangle、
填充下三角形、圆形、正方形、菱形、上三角形、
downtriangle} = Graphics`PlotMarkers[][[全部, 1]]
The inbuilt symbol in Mathematica can be used to define a set of symbols and use them in the order one likes.
{filledcircle, filledsquare, filleddiamond, filleduptriangle,
filleddowntriangle, circle, square, diamond, uptriangle,
downtriangle} = Graphics`PlotMarkers[][[All, 1]]