Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I create several ParametricPlot3D's that all should look the same: BoundaryStyle -> Thick, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}, Boxed -> False, etc. To ensure consistency and make changing the options easier, I would like to specify them only once.

From what I've understood, it's possible to change the default options of ParametricPlot3D permanently by using SetOptions. I don't particularly like this solution, because it would affect the appearance of all ParametricPlot3Ds.

Alternatively, I tried using

para := {BoundaryStyle -> Thick, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}},
         Boxed -> False}
Show[ParametricPlot3D[{u, v, 0}, {u, 0, 1}, {v, 0, 1}], para]

but here MMA complains

An unrecognized option name ("BoundaryStyle") was encountered while reading a Graphics.

This is the original code for one ParametricPlot3D:

ParametricPlot3D[{u, v, 0}, {u, 0, 1}, {v, 0, 1},  
 BoundaryStyle -> Thick, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}, 
 Boxed -> False]

Any suggestion is much appreciated.

share|improve this question

marked as duplicate by Mr.Wizard Apr 14 '13 at 0:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Instead of para := {...} use para = Sequence[...], then do ParamatricPlot3D[..., para] and drop Show. – Szabolcs Apr 13 '13 at 23:41
@Szabolcs: I get 'ParametricPlot3D::nonopt: "Options expected (instead of para) beyond position 3 in ParametricPlot3D[{u,v,0},{u,0,1},{v,0,1},para]. An option must be a rule or a list of rules."' – Frank Apr 13 '13 at 23:55
You can use FilterRules: Sequence@@FilterRules[para, Options[ParametricPlot3D]] – Spawn1701D Apr 14 '13 at 0:04
I am marking this as a duplicate because both the cause and solutions are the same. – Mr.Wizard Apr 14 '13 at 0:28
Also see this: – Mr.Wizard Apr 14 '13 at 0:41
up vote 5 down vote accepted

You can define

para = Sequence[BoundaryStyle -> Thick, AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}}, Boxed -> False]

then use

ParametricPlot3D[{u, v, 0}, {u, 0, 1}, {v, 0, 1}, Evaluate[para]]


Sequence will automatically expand inside of an expression.

In[]:= {1, Sequence[2,3]}
Out[]= {1, 2, 3}

Graphics does accept options given as a list (Graphics[{Circle[]}, {Axes -> False, Frame -> True}]), but many other functions won't. So we need to use Sequence.

BoundaryStyle is an option for ParametricPlot3D, but not for Graphics, therefore it can't be given in Show. So we have to pass the options to ParametricPlot3D directly.

ParametricPlot3D has the HoldAll attribute, which means that para needed to be wrapped in Evaluate to make sure that ParametricPlot3D will see the actual options and not the symbol para.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.