7
votes
2answers
91 views

Change some option of a function when calling it

Say I have defined some function like f[p_] := Plot[Sin[p*x], {x, 0, 2 Pi}] Now in most cases, I just need to specify the value of ...
2
votes
0answers
76 views

How can this function's options be used in different places?

I wrote this function to make a ListPlot where the points are colored by a third argument. ...
13
votes
3answers
156 views

Can I make a default for an optional argument the value of another argument?

I'd like to define a function with several optional arguments, some of which default to the value supplied for other arguments. For example, I'd like to be able to write something like ...
9
votes
1answer
355 views

How to Combine Pattern Constraints and Default Values for Function Arguments

EDIT: As several respondents have noted in the answers and comments below, the original example had a default value that would never be used because of the way patterns and default values are ...