8
$\begingroup$

Today I was banging my head against my desk when I realized that the problem I was experiencing was due to having typed

ImageSize[Large]

instead of

ImageSize -> Large

This is something that I have never really understood since I started using Mathematica. What's the difference and is there an obvious reason why some options are "functions" while others are "rules"?

$\endgroup$
  • 3
    $\begingroup$ ... and some are both: BaseStyle -> PointSize[Large] and BaseStyle -> PointSize->Large $\endgroup$ – kglr Sep 13 '18 at 18:22
  • 4
    $\begingroup$ Well, the reason for PointSize[Large] is that it is submitted as directive to Graphics and Graphics3D; the latter two have their somewhat their own language. I always used to think of options as key-value pairs, even before associations were introduced. When submitting options, the user defined "association" of options opts is merged with the default options defaultopt like it would be done with Merge[{opts, defaultopts}, First]. Maybe that helps you, Kai? $\endgroup$ – Henrik Schumacher Sep 13 '18 at 18:27
  • 2
    $\begingroup$ Wait, when are options functions? Options are always, by definition, specified as rules as far as I can see. $\endgroup$ – Sjoerd Smit Sep 13 '18 at 18:27
  • 3
    $\begingroup$ Thickness and Dashing also work both ways: Graphics[{Dashing -> Small, Thickness[.05], Line[{{0, 0}, {1, 1}}], Thickness -> .01, Dashing[Large], Line[{{0, 1}, {1, 0}}]}] $\endgroup$ – kglr Sep 13 '18 at 18:34
  • 2
    $\begingroup$ ... so do CapForm, JoinForm, Opacity $\endgroup$ – kglr Sep 13 '18 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.