如何在Mathematica中找到一个选项的所有可能值?

16
如果我有一个选项,比如AxesStyle,我该如何找到可能的值?我知道其中一个可能的值是Arrowheads,但我能找到其他的吗?我一直在寻找列表或类似的东西,但迄今为止没有成功。
是否有像Options[]?TicksStyle这样的命令?我知道这些命令不是用于此目的,只是为了得到一个观点。

1
根据文档所示,对于各种Graphics函数,Axes是一个布尔值或布尔值数组,用于指示在给定的Graphics对象中包含哪些轴。 - user554546
4
目前不可能找到给定选项的所有可能值。请参见相关问题以及Prashant回答下Sjoerd的评论。 - user616736
4个回答

5
有时候,某个选项的可能值并没有完全记录。例如,在使用 Plot 时,尝试找出选项 Method 的合法值是什么。Plot 的参考页面只给出了 Method 的默认值,并且用非常一般的术语来描述它。在该页面的示例部分中,Method 甚至没有被列为具有示例的选项之一。而 Method 的参考页面似乎也没有提供任何帮助。在后一个页面上,有一个指向指南页面 Graphics Options And Styling 的链接,而在该指南页面上,"Method" 项目出现在“微调渲染(Tweaking Rendering)”类别下--但同样没有提供可用值的帮助!

3
如果您查看所询问的各种事项的帮助文件并单击“更多信息”下拉菜单,它将为您提供所有选项。
编辑:为了澄清,请确保检查您正在查找的特定设置的帮助文件,而不是使用该设置的功能。

谢谢,我已经看到了。它给了我所有可能的选项,并且每个选项都有一个值,但其他选项呢?例如,对于Plot->FillingStyle->,它给出了Automatic,但如何找出其他可能的选择? - balboa
1
@balboa - 对于你的例子,你可以在图表 - 选项 - 填充样式中查找更多信息,或者直接查找填充样式以获取其他示例。不过这不是全面的。你可以在这里尝试查找更多示例。 - Chris Degnen
你查看了Plot的选项。这显示了在Plot中使用的FillingStyle的默认值。如果你查看FillingStyle的帮助页面,将会得到更多信息。例如,该帮助页面上的第一条信息说:“FillingStyle->g 指定所有默认填充应使用指定的图形指令完成。” - Eli Lansey
好的,我看到这有点复杂,而且据我所了解,Mathematica没有列出选项可能值的简单方法。我应该熟悉指令。 - balboa

2
寻找选项文档的主要位置是选项文档页面和使用该选项的函数的文档页面。打开各个部分,从更多信息开始,但也包括像范围这样的部分(通常有子类别)。
查看函数文档时,有一个整个部分名为选项的部分,其中具有单独选项子部分。因此,您可以查看ListPlot > Examples > Options > Filling,其中包含相当多的信息。
查看选项文档时,特别是对于图形函数,示例可能只显示如何使用代表性函数(例如Plot)设置选项。通常,类似的函数(如ListPlotLogPlot等)将接受该选项的类似设置。

谢谢您的回答,这些子部分中的示例很有用。 - balboa

1
您在问题中提到可以使用选项来查看可用内容。
因此,
Options[Plot]

返回,
{AlignmentPoint -> Center, AspectRatio -> 1/GoldenRatio, Axes -> True,
AxesLabel -> None, AxesOrigin -> Automatic, AxesStyle -> {}, 
Background -> None, BaselinePosition -> Automatic, BaseStyle -> {}, 
ClippingStyle -> None, ColorFunction -> Automatic, 
ColorFunctionScaling -> True, ColorOutput -> Automatic, 
ContentSelectable -> Automatic, CoordinatesToolOptions -> Automatic, 
DisplayFunction :> $DisplayFunction, Epilog -> {}, 
Evaluated -> Automatic, EvaluationMonitor -> None, 
Exclusions -> Automatic, ExclusionsStyle -> None, Filling -> None, 
FillingStyle -> Automatic, FormatType :> TraditionalForm, 
Frame -> False, FrameLabel -> None, FrameStyle -> {}, 
FrameTicks -> Automatic, FrameTicksStyle -> {}, GridLines -> None, 
GridLinesStyle -> {}, ImageMargins -> 0., ImagePadding -> All, 
ImageSize -> Automatic, ImageSizeRaw -> Automatic, LabelStyle -> {}, 
MaxRecursion -> Automatic, Mesh -> None, MeshFunctions -> {#1 &}, 
MeshShading -> None, MeshStyle -> Automatic, Method -> Automatic, 
PerformanceGoal :> $PerformanceGoal, PlotLabel -> None, 
PlotLegends -> None, PlotPoints -> Automatic, 
PlotRange -> {Full, Automatic}, PlotRangeClipping -> True, 
PlotRangePadding -> Automatic, PlotRegion -> Automatic, 
PlotStyle -> Automatic, PlotTheme :> $PlotTheme, 
PreserveImageOptions -> Automatic, Prolog -> {}, 
RegionFunction -> (True &), RotateLabel -> True, 
TargetUnits -> Automatic, Ticks -> Automatic, TicksStyle -> {}, 
WorkingPrecision -> MachinePrecision}

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接