-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlotTheme.m
118 lines (86 loc) · 8.29 KB
/
PlotTheme.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
(* ::Package:: *)
(************************************************************************)
(* This file was generated automatically by the Mathematica front end. *)
(* It contains Initialization cells from a Notebook file, which *)
(* typically will have the same name as this file except ending in *)
(* ".nb" instead of ".m". *)
(* *)
(* This file is intended to be loaded into the Mathematica kernel using *)
(* the package loading commands Get or Needs. Doing so is equivalent *)
(* to using the Evaluate Initialization Cells menu command in the front *)
(* end. *)
(* *)
(* DO NOT EDIT THIS FILE. This entire file is regenerated *)
(* automatically each time the parent Notebook file is saved in the *)
(* Mathematica front end. Any changes you make to this file will be *)
(* overwritten. *)
(************************************************************************)
(* ::Input::Initialization:: *)
Begin["System`PlotThemeDump`"]
Themes`ThemeRules;
(* ::Input::Initialization:: *)
pubThemeFontSize=16;
pubThemeFont="Times";
pubThemeTickFont="Latin Modern Roman";
(* ::Input::Initialization:: *)
joinPlotTheme[l__]:=Themes`SetWeight[Join[l],0.5];
resolvePlotTheme["Publication",def:_String]:=joinPlotTheme[
resolvePlotTheme["PubFrame",def],
resolvePlotTheme["PubLines",def],
resolvePlotTheme["PubColor",def]
];
(* ::Input::Initialization:: *)
resolvePlotTheme["PubFrame",def:_String]:=joinPlotTheme[{Axes->False,Frame->True},resolvePlotTheme["PubFrame2D",def]];
resolvePlotTheme["PubFrame",def:"BarChart"|"PieChart"|"RectangleChart"|"SectorChart"|"CandlestickChart"|"KagiChart"|"LineBreakChart"|"PointFigureChart"|"RenkoChart"|"InteractiveTradingChart"|"TradingChart"|"NumberLinePlot"|"TimelinePlot"]:=resolvePlotTheme["PubFrame2D",def];
(* ::Input::Initialization:: *)
resolvePlotTheme["PubFrame",def:_String/;StringMatchQ[def,___~~"3D"]]:=joinPlotTheme[{Axes->True,AxesEdge->{{-1,-1},{1,-1},{-1,-1}},Boxed->{Left,Bottom,Back}},(*Front axes back box*)resolvePlotTheme["PubFrame3D",def]];
resolvePlotTheme["PubFrame",def:"BarChart3D"|"PieChart3D"|"RectangleChart3D"|"SectorChart3D"]:=resolvePlotTheme["PubFrame3D",def];
(* ::Input::Initialization:: *)
resolvePlotTheme["PubFrame2D",_]:=joinPlotTheme[{
AxesStyle->Directive[AbsoluteThickness[1],Black,FontSize->pubThemeFontSize,FontFamily->pubThemeFont],
FrameStyle->Directive[AbsoluteThickness[1],Black,FontSize->pubThemeFontSize,FontFamily->pubThemeFont],
TicksStyle->Directive[Black,FontSize->pubThemeFontSize,FontFamily->pubThemeTickFont],
FrameTicksStyle->Directive[Black,FontSize->pubThemeFontSize],
GridLinesStyle->Directive[AbsoluteThickness[0.5],Opacity[0.5]]
}];
resolvePlotTheme["PubFrame3D",_]:=joinPlotTheme[{
AxesStyle->Directive[AbsoluteThickness[1],Black,FontSize->pubThemeFontSize,FontFamily->pubThemeFont],
TicksStyle->Directive[Black,FontSize->pubThemeFontSize,FontFamily->pubThemeTickFont],BoxStyle->Black}
];
(* ::Input::Initialization:: *)
resolvePlotTheme["PubColor",def:_String]:=Module[{},
$ThemeColorIndexed=112;(*ColorData[112]=Vibrant*)
$ThemeColorDensity="ThermometerColors";(*Thermometer for density*)
$ThemeColorArrayPlot={GrayLevel[0],GrayLevel[1]};(*Grayscale for Array*)
$ThemeColorDensity3D="ThermometerColors";(*Thermometer for density*)
$ThemeColorVectorDensity="VibrantColorVectorDensityGradient";
$ThemeColorFinancial={RGBColor[0.,0.596078,0.109804],RGBColor[0.790588,0.201176,0.]};(*Green and red*)
$ThemeColorGradient={RGBColor[0.790588,0.201176,0.],RGBColor[0.567426,0.32317,0.729831],RGBColor[0.192157,0.388235,0.807843],RGBColor[0.,0.596078,0.109804],RGBColor[1.,0.607843,0.]};
$ThemeColorMatrix=(*Red-blue split*){{0,RGBColor[0.128105,0.25882,0.538562]},{0.1,RGBColor[0.192157,0.388235,0.807843]},{0.499999,RGBColor[0.8384314,0.877647,0.9615686]},{0.5,RGBColor[{1,1,1}]},{0.500001,RGBColor[0.9581176,0.8402352,0.8]},{0.9,RGBColor[0.790588,0.201176,0.]},{1,RGBColor[0.527059,0.134117,0.]}};
$ThemeColorFractal="VibrantColorFractalGradient";
$ThemeColorWavelet={RGBColor[0.0621178,0.273882,0.727059],RGBColor[0.790588,0.201176,0.],RGBColor[1.,0.607843,0.],RGBColor[1.,1.,1.]};
resolvePlotTheme["ColorStyle",def]
];
(* ::Input::Initialization:: *)
resolvePlotTheme["PubLines","Plot"|"ListLinePlot"]:={PlotStyle->Thick};
(* ::Input::Initialization:: *)
resolvePlotTheme["PubOpenMarkers",def:_String]:={};
resolvePlotTheme["PubOpenMarkers","DateListLogPlot"|"DateListPlot"|"DiscretePlot"|"ListCurvePathPlot"|"ListLinePlot"|"ListLogLinearPlot"|"ListLogLogPlot"|"ListLogPlot"|"ListPlot"]:=joinPlotTheme[{PlotMarkers->Module[{s1=2.,s2=1.8,s3=2.5,s4=1.3,thickness=1.5},{
Graphics[{{White,Disk[{0,0},Offset[{s1,s1}]]},{AbsoluteThickness[thickness],Dashing[{}],Circle[{0,0},Offset[{s1,s1}]]}}],Graphics[{{White,Polygon[{Offset[{0,2*s4}],Offset[s4*{-Sqrt[3],-1}],Offset[s4*{Sqrt[3],-1}]}]},{AbsoluteThickness[thickness],Dashing[{}],JoinedCurve[Line[{Offset[{0,2*s4}],Offset[s4*{-Sqrt[3],-1}],Offset[s4*{Sqrt[3],-1}],Offset[{0,2*s4}]}],CurveClosed->True]}}],Graphics[{{White,Polygon[{Offset[{0,s3}],Offset[{s3,0}],Offset[{0,-s3}],Offset[{-s3,0}]}]},{AbsoluteThickness[thickness],Dashing[{}],Line[{Offset[{0,s3}],Offset[{s3,0}],Offset[{0,-s3}],Offset[{-s3,0}],Offset[{0,s3}]}]}}],Graphics[{{White,Polygon[{Offset[{-s2,-s2}],Offset[{s2,-s2}],Offset[{s2,s2}],Offset[{-s2,s2}],Offset[{-s2,-s2}]}]},{AbsoluteThickness[thickness],Dashing[{}],Line[{Offset[{-s2,-s2}],Offset[{s2,-s2}],Offset[{s2,s2}],Offset[{-s2,s2}],Offset[{-s2,-s2}]}]}}],Graphics[{{White,Polygon[{Offset[{0,-2*s4}],Offset[s4*{-Sqrt[3],1}],Offset[s4*{Sqrt[3],1}]}]},{AbsoluteThickness[thickness],Dashing[{}],JoinedCurve[Line[{Offset[{0,-2*s4}],Offset[s4*{-Sqrt[3],1}],Offset[s4*{Sqrt[3],1}],Offset[{0,-2*s4}]}],CurveClosed->True]}}]}]}
];
resolvePlotTheme["PubClosedMarkers","DateListLogPlot"|"DateListPlot"|"DiscretePlot"|"ListCurvePathPlot"|"ListLinePlot"|"ListLogLinearPlot"|"ListLogLogPlot"|"ListLogPlot"|"ListPlot"]:=joinPlotTheme[{PlotMarkers->Module[{s1=2.,s2=1.8,s3=2.5,s4=1.3,thickness=1.5},{
Graphics[{{Disk[{0,0},Offset[{s1,s1}]]},{AbsoluteThickness[thickness],Dashing[{}],Circle[{0,0},Offset[{s1,s1}]]}}],Graphics[{{Polygon[{Offset[{0,2*s4}],Offset[s4*{-Sqrt[3],-1}],Offset[s4*{Sqrt[3],-1}]}]},{AbsoluteThickness[thickness],Dashing[{}],JoinedCurve[Line[{Offset[{0,2*s4}],Offset[s4*{-Sqrt[3],-1}],Offset[s4*{Sqrt[3],-1}],Offset[{0,2*s4}]}],CurveClosed->True]}}],Graphics[{{Polygon[{Offset[{0,s3}],Offset[{s3,0}],Offset[{0,-s3}],Offset[{-s3,0}]}]},{AbsoluteThickness[thickness],Dashing[{}],Line[{Offset[{0,s3}],Offset[{s3,0}],Offset[{0,-s3}],Offset[{-s3,0}],Offset[{0,s3}]}]}}],Graphics[{{Polygon[{Offset[{-s2,-s2}],Offset[{s2,-s2}],Offset[{s2,s2}],Offset[{-s2,s2}],Offset[{-s2,-s2}]}]},{AbsoluteThickness[thickness],Dashing[{}],Line[{Offset[{-s2,-s2}],Offset[{s2,-s2}],Offset[{s2,s2}],Offset[{-s2,s2}],Offset[{-s2,-s2}]}]}}],Graphics[{{Polygon[{Offset[{0,-2*s4}],Offset[s4*{-Sqrt[3],1}],Offset[s4*{Sqrt[3],1}]}]},{AbsoluteThickness[thickness],Dashing[{}],JoinedCurve[Line[{Offset[{0,-2*s4}],Offset[s4*{-Sqrt[3],1}],Offset[s4*{Sqrt[3],1}],Offset[{0,-2*s4}]}],CurveClosed->True]}}]}]}
];
(* ::Input::Initialization:: *)
End[]
(* ::Input::Initialization:: *)
Options[plotGrid]={ImagePadding->40};
plotGrid[l_List,w_,h_,opts:OptionsPattern[]]:=Module[{nx,ny,sidePadding=OptionValue[plotGrid,ImagePadding],topPadding=0,widths,heights,dimensions,positions,frameOptions=FilterRules[{opts},FilterRules[Options[Graphics],Except[{ImagePadding,Frame,FrameTicks}]]]},{ny,nx}=Dimensions[l];
widths=(w-2 sidePadding)/nx Table[1,{nx}];
widths[[1]]=widths[[1]]+sidePadding;
widths[[-1]]=widths[[-1]]+sidePadding;
heights=(h-2 sidePadding)/ny Table[1,{ny}]+15;
heights[[1]]=heights[[1]]+sidePadding;
heights[[-1]]=heights[[-1]]+sidePadding;
positions=Transpose@Partition[Tuples[Prepend[Accumulate[Most[#]],0]&/@{widths,heights}],ny];
Graphics[Table[Inset[Show[l[[ny-j+1,i]],ImagePadding->{{If[i==1,sidePadding+20,0],If[i==nx,20,0]},{If[j==1,sidePadding,0],If[j==ny,sidePadding,topPadding]}},AspectRatio->Full],positions[[j,i]],{Left,Bottom},{widths[[i]],heights[[j]]}],{i,1,nx},{j,ny,1,-1}],PlotRange->{{0,w},{0,h}},ImageSize->{w,h},Evaluate@Apply[Sequence,frameOptions]]]