Questions dealing with optional named arguments of Mathematica functions.

learn more… | top users | synonyms

44
votes
2answers
2k views

Extract values for ViewMatrix from a Graphics3D

Under More Information in the help page of ViewMatrix the following entry can be found With the setting ...
62
votes
4answers
3k views

Functions with Options

Suppose you want to create a function which has optional arguments. Maeder's book "Programming in Mathematica" covers the topic extensively up to version 3, but some things have changed/evolved since ...
84
votes
5answers
3k views

How can one find undocumented options or option values in Mathematica?

Mathematica has a lot of undocumented or poorly documented options. How does one go about working out if there is an undocumented option that might solve a particular problem? How does one work out ...
6
votes
1answer
2k views

Fixed color scale in multiple density plots

I think there should be a simple solution for my current problem, but neither StackOverflow (or the help of Mathematica) or Google have it. I have to plot multiple density plots with a color ...
5
votes
2answers
479 views

Evaluating an If condition to yield True/False

I would like to decide whether an option passed to my custom function has the value Automatic or something else. This is my attempt: ...
15
votes
3answers
612 views

How to get the real PlotRange using AbsoluteOptions?

The problem in general involves the unreliable behaviour of AbsoluteOptions when option values are implicitly specified (e.g. ...
34
votes
3answers
2k views

How to find out which method Mathematica selected?

There are commands like NonlinearModelFit[] or NDSolve[] that have the option Method it ...
37
votes
6answers
2k views

How can I create a function with optional arguments and options?

Is it possible to create a function with optional arguments that also takes options? Here is a simple example. I have a function f with option "g". It also has ...
17
votes
3answers
386 views

How can I work out which functions work with SetOptions?

Not all functions seem to work with SetOptions. e.g. ...
9
votes
1answer
508 views

Running an initialization cell on Mathematica start up [duplicate]

I am writing a bash script to run a bunch of Mathematica .nb files serially. So I thought I'd convert my Mathematica cells into ...
9
votes
2answers
451 views

Solving/Reducing equations in $\mathbb{Z}/p\mathbb{Z}$

I was trying to find all the numbers $n$ for which $2^n=n\mod 10^k$ using Mathematica. My first try: Reduce[2^n == n, n, Modulus -> 100] However, I receive ...
9
votes
1answer
640 views

How to tell mathematica not to resolve stiffness issues

Very often I solve partial differential equations that are nonlinear and could be up to 4th order. In these cases, it is usual for the solution determined by ...
11
votes
2answers
248 views

Function with custom Options and modified Options for built-in Symbols

I couldn't find a more descriptive title, but I guess an example will explain my problem. I set up some customized Grid function including some additional ...
21
votes
2answers
308 views

Evaluation of OptionValue[]

I have a function that takes an OptionsPattern and I want to access several options, say a, and ...
11
votes
2answers
494 views

Factorizing polynomials over fields other than $\mathbb{C}$

I'd like to take a polynomial in $\mathbb{Z}_5[x]$ of the form $ax^2+bx+c$ and factor it into irreducible polynomials. For example: Input... x^2+4 Output... ...
16
votes
2answers
3k views

How to save plots in grayscale

As sophomoric as this question seems, how should I save plots in grayscale in Mathematica? I generally like eps images for their scalability and I use ghostscript or other third party perl scripts ...
11
votes
2answers
575 views

About number truncation of ticks display in ListPlot

In my problem, I need to plot a figure in a relatively small region of the $x$ axis, e.g., ...
16
votes
2answers
662 views

Plot Option Precedence while combining Plots with `Show[]`

I like to build sophisticated plots by combining simpler ones with Show[]. Typically this involves setting non-default Plot-Options with the different ...
7
votes
2answers
740 views

How to reverse the direction of the y axes

I have a similar question to this one. Unfortunately, the answers there didn't help me. I would like to plot a simple function with the normal Plot function. ...
11
votes
1answer
2k views

What method does NDSolve use for solving PDEs?

What is NDSolve's mode of operation? I use it to solve partial differential equations and never gave it too much thought. Recently, I came across this question. ...
4
votes
1answer
84 views

When to use GenerateConditions -> True

Many functions, usuallly those involving integration, take a GenerateConditions option which often defaults to False, or at ...
1
vote
1answer
70 views

SetOptions and Cell

I'm trying to change the CellLabel of Cells using SetOptions[Cell, CellLabel -> "test"] or ...
9
votes
3answers
382 views

Dealing with nested options

OptionValue allows for recent versions of Mathematica (I think as from 7) to easily access optional parameters if they are explicitely given to a function or their default values otherwise. For big ...
16
votes
4answers
674 views

How to plot a curve with border around the line?

This can be useful if the curve is passing over both dark and light backgrounds (like well-done subtitles in movies).
14
votes
1answer
285 views

Method -> {“AxesInFront” -> False} for Graphics3D

I'm aware of two ways to manage positioning of Axes for Graphics3D: AxesOrigin and ...
11
votes
3answers
299 views

Pass by reference for an option argument

Pass by reference can be faked by using HoldAll or something similar in the definition of a "Function". But can pass by reference be faked for symbols passed as ...
10
votes
4answers
221 views

Is it possible to separately call the default value of a variable which isn't at the end of the sequence?

After reading this post I recalled an old question I once met. We know that we can set default values for variables of a function: ...
12
votes
3answers
951 views

Number format of axes in a plot

How can I have a conditional format of the values appearing in the axis of a plot ? I have in mind the number format options available in Excel for plots as described here ...
6
votes
1answer
321 views

What does MaxStepFraction do?

I find that with NDSolve[...] while solving a partial differential equation, changing the MaxStepFraction from ...
4
votes
1answer
269 views

Is there a way to globally set when to treat a very small number as zero?

I understand that I can use Chop to force a very small number to be treated as 0 and can use ...
9
votes
0answers
185 views

Setting non-standard ImageResolution for EMF export as default

Mathematica has a bug in that BarCharts and ListPlots with Filling will export as a ...
7
votes
2answers
383 views

Why does ListPlot ignore some global options?

Why does the following plot no use the global PlotMarkers option? ...
5
votes
1answer
120 views

Setting options of expressions similar to using SetOptions on objects

Introduction I often have the problem that in an expression, I want to change an option. If we are sure the option is not present, we could simply use ...
5
votes
3answers
304 views

How to preserve clipping when exporting a framed histogram with font embedding?

I work with histograms and would like to export it to EPS format. I've noticed that my exported image loses the PlotRangeClipping option that I set up when I export the plot. This is true for at least ...
3
votes
4answers
265 views

Change all Options of Plot Dynamically

I am trying to make a series of changes in the appearance of the Plot of some function. I am trying to use Manipulate for my experiments. I tried to change the following code ...
29
votes
1answer
312 views

Quickly look-up usages, options and attributes of symbols

When I'm writing code in the front-end, I find myself very often looking up the list of options of a symbol over and over again in the documentation center. In most cases you find there a list of ...
13
votes
4answers
379 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: ...
12
votes
2answers
450 views

Saving a notebook without output lines

Is it possible to change the way Mathematica saves so that Out[] lines are never included? I have a .nb file that processes a ...
14
votes
2answers
291 views

Why doesn't Mathematica use uniform criteria for validating Options?

Plot[Sin[x], {x, 0, 1}, pp -> 0] Gives as expected: Plot::optx: Unknown option pp in Plot[Sin[x],{x,0,1},pp->0]. >> However: ...
10
votes
3answers
748 views

Passing down arguments

In R, one can use ... to pass arguments down to another function. For example ...
9
votes
2answers
243 views

Is there a way to programmatically set global preferences?

Can I set global preferences that are accessible via "Edit"->"Preferences" programmatically from within a notebook? As learned from this question, turning off anti-aliasing can make a huge difference ...
10
votes
1answer
236 views

Pass Options to Export[]

I'm working with Options to change the look and feel of some generated Graphics by passing Options to several functions, one of them being Export[]. For example: ...
10
votes
2answers
322 views

Determining the default Method used in optimization and root-finding algorithms

Is it possible to extract the Method which is used in functions like NMinimize, FindRoot, ...
5
votes
3answers
242 views

How to disable differential styles/markers/etc. for multiple entities?

For functions that can produce multiple "style-able" entities, Mathematica by default will give each such entity a different style. Similar conventions apply to other features, either by default, or ...
5
votes
3answers
221 views

Switching among view points in a Manipulate expression

Edit: Some additional viewpoints were included to make it easier to test. Here's code for an alternative function, the graph of which is a bit less symmetric. Feel free to use either code set: ...
15
votes
3answers
384 views

How can I set Grid alignments using numbers?

There is an example in the Alignment documentation (it also appears in the Grid documentation): ...
9
votes
2answers
894 views

Labels and tickmarks inside Frame

Is there a way to force Plot and related functions to place the tick labels inside, rather than outside a frame? For example, consider, ...
6
votes
2answers
657 views

How to set the NDSolve method to LSODA

I notice that off all the Method options available for NDSolve[...], LSODA is invoked quite ...
4
votes
2answers
97 views

Fractions formatting in Column / Grid

Fractions are squished in GridBox: ...
3
votes
1answer
249 views

Evaluating function only when its optional argument is numeric

I want to have the argument 'a' for myf2 in form of optional argument, but at the same time I need to evaluate the function only if 'a' is Numeric, see also my previous question. ...