Debian Codegraph @

texmf-dist/tex/latex/numericplots/NumericPlots_legend.tex

raw
1
2 % ----------------------------------------------------------------------------
3 % | keys for the legend
4 % ----------------------------------------------------------------------------
5
6 \define@key[NumericDataPlot]{Legend}{nrCols}[1]{\renewcommand{\nrLegendCols}{#1}}%
7 \define@key[NumericDataPlot]{Legend}{LegLineWidth}[20pt]{\setlength{\LegLineWidth}{#1}}%
8
9 \define@choicekey+[NumericDataPlot]{Legend}{LabelOrientation}[\val\nrLegOrient]
10 {r,l,c}{%
11 \ifcase\nrLegOrient\relax%
12 \setboolean{LegendOrientationLeft}{false}%
13 \setboolean{LegendOrientationRight}{true}%
14 \setboolean{LegendOrientationCenter}{false}%
15 \or%
16 \setboolean{LegendOrientationLeft}{true}%
17 \setboolean{LegendOrientationRight}{false}%
18 \setboolean{LegendOrientationCenter}{false}%
19 \or%
20 \setboolean{LegendOrientationLeft}{false}%
21 \setboolean{LegendOrientationRight}{false}%
22 \setboolean{LegendOrientationCenter}{true}%
23 \fi%
24 }{
25 \PackageWarning{NumericPlots}{LabelOrientation #1 not defined. Use r, l or c}%
26 }
27
28
29 % ==============================================================================
30 % ||
31 % || legend
32 % ||
33 % ==============================================================================
34
35
36 \newcommand{\LegLineOld}[2][]{%
37 \setkeys[NumericDataPlot]{Legend}{#1}
38 %
39 \centering\Rnode{lab#2}{}%
40 \psline[style=#2,showpoints=false]([nodesep=0.5\LegLineWidth]lab#2)([nodesep=-0.5\LegLineWidth]lab#2)%
41 \psline[style=#2](lab#2)(lab#2)%
42 }
43
44 % \newcommand{\LegLine}[2][]{%
45 % \setkeys[NumericDataPlot]{Legend}{#1}
46 % %
47 % \centering\Rnode{LegLineNode}{}%
48 % \psline[#2,showpoints=false]([nodesep=0.5\LegLineWidth]LegLineNode)([nodesep=-0.5\LegLineWidth]LegLineNode)%
49 % \psline[#2, linestyle=none](LegLineNode)(LegLineNode)
50 % }
51 %
52 %
53 % \newcommand{\LegendDefinition}[2][nrCols]{%
54 % \setkeys[NumericDataPlot]{Legend}{#1}%
55 % %
56 % \psframebox[style=LegendBoxStyle]{%
57 % \ifLegendOrientationLeft
58 % \begin{tabular}{*{\nrLegendCols}{p{\LegLineWidth}l}}%
59 % #2%
60 % \end{tabular}%
61 % \fi
62 % \ifLegendOrientationCenter
63 % \begin{tabular}{*{\nrLegendCols}{p{\LegLineWidth}c}}
64 % #2
65 % \end{tabular}
66 % \fi
67 % \ifLegendOrientationRight
68 % \begin{tabular}{*{\nrLegendCols}{p{\LegLineWidth}r}}
69 % #2
70 % \end{tabular}
71 % \fi
72 % }%psframebox
73 % }
74
75 \newcommand{\LegLine}[2][]{%
76 \setkeys[NumericDataPlot]{Legend}{#1}%
77 \parbox[t]{\LegLineWidth}{%
78 \centering\Rnode{LegLineNode}{}%
79 \psline[#2,showpoints=false]([nodesep=0.5\LegLineWidth]LegLineNode)([nodesep=-0.5\LegLineWidth]LegLineNode)%
80 \psline[#2,linestyle=none](LegLineNode)(LegLineNode)%
81 }
82 }
83
84 \newcommand{\LegDot}[2][]{%
85 \setkeys[NumericDataPlot]{Legend}{#1}%
86 \parbox[t]{\LegLineWidth}{%
87 \centering\Rnode{LegLineNode}{}%
88 \psdots[#2](LegLineNode)%
89 }
90 }
91
92 \newcommand{\LegendDefinition}[2][nrCols]{%
93 \setkeys[NumericDataPlot]{Legend}{#1}%
94 %
95 \psframebox[style=LegendBoxStyle]{%
96 \ifLegendOrientationLeft%
97 \begin{tabular}{*{\nrLegendCols}{ll}}%
98 #2%
99 \end{tabular}%
100 \fi
101 \ifLegendOrientationCenter
102 \begin{tabular}{*{\nrLegendCols}{cc}}
103 #2
104 \end{tabular}
105 \fi
106 \ifLegendOrientationRight
107 \begin{tabular}{*{\nrLegendCols}{cr}}
108 #2
109 \end{tabular}
110 \fi
111 }%psframebox
112 }