Question

I wonder if it is possible to make a variable that holds info obout wanted style for Show[] function. So ewery time i want to display plots in Show[] i will insert that variable in Show[] to set options for style.

I want something like this...

OPTIONS=
     AxesOrigin -> Automatic,
     LabelStyle -> Directive[14, Black, Bold, Italic],
     ImageSize -> {450}

    Show[
     ListLinePlot[data],
     OPTIONS
     ]

The solution is simple but im green. :)

Was it helpful?

Solution

OPTIONS = {AxesOrigin -> Automatic, 
  LabelStyle -> Directive[14, Red, Bold, Italic], ImageSize -> {450}}

Show[ListLinePlot[{1, 2, 3, 4, 5}], OPTIONS]

Works for me.

OTHER TIPS

You could apply Show with options to graphics automatically using $Post, e.g.

$Post := With[{opts = {
     AxesOrigin -> Automatic,
     LabelStyle -> Directive[14, Black, Bold, Italic],
     ImageSize -> {250}}},
  If[Head[#] === Graphics, Show[#, opts], #] &]

ListLinePlot[{1, 2, 3, 4, 5}]

enter image description here

Restoring $Post to default:

$Post =.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top