Linked Questions

3 votes
2 answers
365 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 ...
Espen Brun's user avatar
7 votes
2 answers
204 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 ...
Bernd's user avatar
  • 955
1 vote
1 answer
123 views

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

How do i safely, efficiently, and elegantly select compatible options? I normally do ...
qazwsx's user avatar
  • 8,666
2 votes
0 answers
108 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. ...
ArgentoSapiens's user avatar
1 vote
0 answers
88 views

Combine two options lists [duplicate]

I have 2 functions Top and Bottom that each have an options list parameter. ...
Willy Van den Driessche's user avatar
598 votes
19 answers
155k 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 ...
45 votes
5 answers
5k 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 ...
F'x's user avatar
  • 10.8k
19 votes
4 answers
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: <...
Jason B.'s user avatar
  • 67.3k
19 votes
3 answers
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 ...
dotcs's user avatar
  • 587
17 votes
3 answers
6k 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}} ...
nilo de roock's user avatar
9 votes
2 answers
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:
Serkan's user avatar
  • 183
15 votes
2 answers
1k views

Inheriting Options?

This question is an extension of Passing down arguments. To help clarify my question, I will be referring to another recent post of mine Making Quartile Plots from a Dataset, the code to which can be ...
SumNeuron's user avatar
  • 5,372
21 votes
2 answers
632 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 ...
Kuba's user avatar
  • 136k
12 votes
2 answers
1k views

Prevent Export from overwriting files

Export["filepath1",Expression1] works for me, but if filepath1 already exists, it will be overwritten. I'd like ...
user1541776's user avatar
6 votes
3 answers
2k 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 ...
yada's user avatar
  • 163

15 30 50 per page