3

Is it possible to assign a couple of Plot options like e.g.

Frame -> True, PlotRange -> All, ImageSize -> 500

to a variable so that I can use it instead of repeating all options in my next plot?

corey979
  • 23,947
  • 7
  • 58
  • 101
runner
  • 85
  • 1
  • 6

1 Answers1

4

First of all, one should mention that it is possible to define a custom PlotTheme:

Is it possible to define a new PlotTheme?

Second, something like @Henrik Schumacher's suggestion is possible, but (1) you need to use Evaluate and (2) one can use a simple List instead of Sequence, which makes combining and adding options somewhat easier.

A couple of examples:

myPlotOpts = {Frame -> True, PlotRange -> All, ImageSize -> 500};

Plot[Sin[x], {x, -6, 6}, Evaluate@myPlotOpts]

Mathematica graphics

It combines with other options without having to worry about the list structure:

Plot[Sin[x], {x, -6, 6}, PlotStyle -> Red, Evaluate@myPlotOpts]

Mathematica graphics

Michael E2
  • 235,386
  • 17
  • 334
  • 747