summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/numericplots/NumericPlots_macros.tex
blob: 4bb33d1c93fd98fb4851ba119be32cdb6c17325f (plain)
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
% ==============================================================================
% ||
% || commands...
% ||
% ==============================================================================

\newcommand{\NDPput}[2][]{
	\setkeys[NumericDataPlot]{put}{RefPoint=c}
	\setkeys[NumericDataPlot]{put}{Rot=0}
	\setkeys[NumericDataPlot]{put}{#1}
	\rput[\NDPRefPoint]{\NDPputRotation}(\NDPputXcoord, \NDPputYcoord){#2}
}


\newcommand{\NDPhline}[2][]{
%
	\FPsub{\NumDataPlotBuffer}{#2}{\NumDataPlotyMin}
	\FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotyDataCoordRatio}
	\FPadd{\NDPputYcoord}{\NumDataPlotBuffer}{\NumDataPlotyCoordMin}

	\psline[#1](\NumDataPlotxCoordMin, \NDPputYcoord)
		(\NumDataPlotxCoordMax,	\NDPputYcoord)
}

\newcommand{\NDPvline}[2][]{
%
	\FPsub{\NumDataPlotBuffer}{#2}{\NumDataPlotxMin}
	\FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxDataCoordRatio}
	\FPadd{\NDPputXcoord}{\NumDataPlotBuffer}{\NumDataPlotxCoordMin}
%
	\psline[#1](\NDPputXcoord, \NumDataPlotyCoordMin)
		(\NDPputXcoord, \NumDataPlotyCoordMax)
}

\newcommand{\NDPline}[5][]{
%
	\FPsub{\NumDataPlotBuffer}{#2}{\NumDataPlotxMin}
	\FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxDataCoordRatio}
	\FPadd{\NDPputXcoordOne}{\NumDataPlotBuffer}{\NumDataPlotxCoordMin}
	
	\FPsub{\NumDataPlotBuffer}{#2}{\NumDataPlotxMin}
	\FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxDataCoordRatio}
	\FPadd{\NDPputXcoordOne}{\NumDataPlotBuffer}{\NumDataPlotxCoordMin}
	
	
	\psline[#1]
		(!#2 \NumDataPlotxMin\space sub	\NumDataPlotxDataCoordRatio\space mul
		\NumDataPlotxCoordMin\space	add
		#3 \NumDataPlotyMin\space sub	\NumDataPlotyDataCoordRatio\space mul
		\NumDataPlotyCoordMin\space	add)
		(!#4 \NumDataPlotxMin\space sub	\NumDataPlotxDataCoordRatio\space mul
		\NumDataPlotxCoordMin\space	add
		#5 \NumDataPlotyMin\space sub	\NumDataPlotyDataCoordRatio\space mul
		\NumDataPlotyCoordMin\space	add)
}

\newcommand{\NDPvbox}[3][]{

	\psframe[#1]
		(!#2 \NumDataPlotxMin\space sub	\NumDataPlotxDataCoordRatio\space mul \NumDataPlotxCoordMin\space	add
		\NumDataPlotyCoordMin)
		(!#3 \NumDataPlotxMin\space sub	\NumDataPlotxDataCoordRatio\space mul \NumDataPlotxCoordMin\space	add
		\NumDataPlotyCoordMax)
}

\newcommand{\NDPhbox}[3][]{
	
    \psframe[#1]
		(!\NumDataPlotxCoordMin \space
		#2 \NumDataPlotyMin\space sub \NumDataPlotyDataCoordRatio\space mul \NumDataPlotyCoordMin\space	add)
		(!\NumDataPlotxCoordMax \space
		#3 \NumDataPlotyMin\space sub \NumDataPlotyDataCoordRatio\space mul \NumDataPlotyCoordMin\space	add)
}

\newcommand{\NDPbox}[5][]{
%	\FPsub{\NumDataPlotBuffer}{#2}{\NumDataPlotxMin}
%	\FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxDataCoordRatio}
%	\FPadd{\NDPputXcoordOne}{\NumDataPlotBuffer}{\NumDataPlotxCoordMin}
%	
%	\FPsub{\NumDataPlotBuffer}{#2}{\NumDataPlotxMin}
%	\FPmul{\NumDataPlotBuffer}{\NumDataPlotBuffer}{\NumDataPlotxDataCoordRatio}
%	\FPadd{\NDPputXcoordOne}{\NumDataPlotBuffer}{\NumDataPlotxCoordMin}
%	
%	
	\psframe[#1]
		(!#2 \NumDataPlotxMin\space sub	\NumDataPlotxDataCoordRatio\space mul
		\NumDataPlotxCoordMin\space	add
		#3 \NumDataPlotyMin\space sub	\NumDataPlotyDataCoordRatio\space mul
		\NumDataPlotyCoordMin\space	add)
		(!#4 \NumDataPlotxMin\space sub	\NumDataPlotxDataCoordRatio\space mul
		\NumDataPlotxCoordMin\space	add
		#5 \NumDataPlotyMin\space sub	\NumDataPlotyDataCoordRatio\space mul
		\NumDataPlotyCoordMin\space	add)
}

% ============================================================================
% ||
% ||  plotting commands
% ||
% ============================================================================

% if data is exported with options.NaNsplit=true it may be plotted with
% \multilistplot{style=xx}{DataIDENT}
% First argument of the function is passed to listplot.
% Second argument must be the Identifier of the Data that should be plotted.
\newcommand{\multilistplot}[2]{
	\multido{\iA=1+1}{\csname #2NrRanges\endcsname}{
		\listplot[#1]{\csname #2\iA\endcsname}%
	}
}


% ===========================================================================
% ||
% || commands to put something at a location of the plot
% ||
% ===========================================================================

% put in the NorthWest corner of the plot
\newcommand{\putNW}[1]{
\rput[lt]{0}(\NumDataPlotxCoordMin, \NumDataPlotyCoordMax){#1}}
% put in the SouthWest corner of the plot
\newcommand{\putSW}[1]{
\rput[lb]{0}(\NumDataPlotxCoordMin, \NumDataPlotyCoordMin){#1}}
% put in the NorthEast corner of the plot
\newcommand{\putNE}[1]{
\rput[rt]{0}(\NumDataPlotxCoordMax, \NumDataPlotyCoordMax){#1}}
% put in the SouthEast corner of the plot
\newcommand{\putSE}[1]{
\rput[rb]{0}(\NumDataPlotxCoordMax, \NumDataPlotyCoordMin){#1}}
% put in the South of the plot
\newcommand{\putS}[1]{
\rput[b]{0}(!\NumDataPlotxCoordMax\space\NumDataPlotxCoordMin\space sub 2 div
\NumDataPlotxCoordMin\space add \NumDataPlotyCoordMin){#1}}
% put in the North of the plot
\newcommand{\putN}[1]{
\rput[t]{0}(!\NumDataPlotxCoordMax\space\NumDataPlotxCoordMin\space sub 2 div
\NumDataPlotxCoordMin\space add \NumDataPlotyCoordMax){#1}}
% put in the West of the plot
\newcommand{\putW}[1]{
\rput[l]{0}(!\NumDataPlotxCoordMin\space
\NumDataPlotyCoordMax\space\NumDataPlotyCoordMin\space sub 2 div \NumDataPlotyCoordMin\space add){#1}}
% put in the East of the plot
\newcommand{\putE}[1]{
\rput[r]{0}(!\NumDataPlotxCoordMax\space
\NumDataPlotyCoordMax\space\NumDataPlotyCoordMin\space sub 2 div \NumDataPlotyCoordMin\space add){#1}}
% put exponent at y-axis
\newcommand{\putExpY}[1]{
\rput[lb]{0}(\NumDataPlotxCoordMin, \NumDataPlotyCoordMax){#1}
}
% put exponent at x-axis
\newcommand{\putExpX}[1]{
\rput[lb]{0}(\NumDataPlotxCoordMax, \NumDataPlotyCoordMin){#1}
}