Linked Questions

3
votes
2answers
327 views

Handling options in my function [duplicate]

It seems this should be easy, by I just can not figure out how. I'm making many very similar style plots, so I want to make a function with all the default options specified. Sometimes I need to tweak ...
7
votes
2answers
183 views

Change some option of a function when calling it [duplicate]

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 ...
1
vote
1answer
115 views

What's the best way to select compatible options? [duplicate]

How do i safely, efficiently, and elegantly select compatible options? I normally do ...
2
votes
0answers
100 views

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

I wrote this function to make a ListPlot where the points are colored by a third argument. ...
1
vote
0answers
77 views

Combine two options lists [duplicate]

I have 2 functions Top and Bottom that each have an options list parameter. ...
534
votes
19answers
134k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
43
votes
5answers
4k views

Saner alternative to ContourPlot fill

I am producing a large number of ContourPlot objects, which when exported generate notoriously large PDF files because it basically generates lots of little ...
19
votes
3answers
1k views

Custom functions by delegating options in a specific way and using core functions

I'd like to create a custom function that does essentially the same as a core function of mathematica but uses different default settings. Example: I want a Plot function that uses Mathematica's core ...
16
votes
4answers
2k views

How to make a function with its own options as well as passing options to other functions [duplicate]

I have a function with many of its own options, but I would also like to pass options to subfunctions using the FilterRules function. Here's a simple example: <...
16
votes
3answers
4k views

How can I type-check the arguments of a Mathematica function?

(For educational purposes) I defined the following functions: Translation (in $\mathbb{R}^2$): trM[vec_] := {{1, 0, vec[[1]]}, {0, 1, vec[[2]]}, {0, 0, 1}} ...
9
votes
2answers
1k views

How can I draw a grid behind graphics without using Plot?

I want to a show simple vector summation but I don't know how to draw a grid behind the vectors. I am pretty sure I can do it with Mathematica but how? It should look like this:
20
votes
2answers
473 views

Clean and handy Options management/filtering

the case I want to be able to create a function with some default options but also without need to add full explicit list of options available for it. And then inside I want to be able to filter ...
6
votes
3answers
1k views

Plotting jump function without vertical lines

Consider this list plot: ListPlot[{{0, 0}, {1, 2}, {3, 4}, {4, 2}, {6, 0}}] I want to draw a jump function in this list plot such that for each point I get a ...
11
votes
2answers
482 views

How to build private function with built-in function's option

Since this code work well: ...
6
votes
1answer
2k views

Hodrick–Prescott filter (one-sided version)

I am interested in implementing Hodrick–Prescott filter (HP filter) on my time series data in Mathematica. I know that there is already a version of two-sided original filter for Mathematica (see ...

15 30 50 per page