2013-03-01 47 views
2

我想知道是否有可能为Show []函数创建一个包含info obout想要的样式的变量。所以ewery时间我想在Show []中显示图,我会在Show []中插入该变量来设置样式选项。保存列表中的打印选项

我想是这样的......

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

    Show[ 
    ListLinePlot[data], 
    OPTIONS 
    ] 

解决方法很简单,但即时通讯绿色。 :)

回答

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

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

适合我。

+0

由于我不知道我必须用 “” 做:) – urosjarc 2013-03-01 22:26:27

0

您可以使用$Post(例如,)自动将图形选项Show应用于图形。

$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

恢复$Post默认:

$Post =.