summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib/numericplots/doc/src/TechnicalDetails.tex
blob: 9b5bdb7df1eae5fa4cc1b8eca0d5f569b275cdea (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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
% Copyright 2013 Thomas Koenig, Alexander Michel
%
% This file is part of NumericPlots.
%
% NumericPlots is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% any later version.
%
% NumericPlots is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with NumericPlots.  If not, see <http://www.gnu.org/licenses/>.

\section{Details}

\subsection{Labels and TickLabels}\label{sec:Details:Labels}

% mit input und lstinputlisting liese sich auch eine Umgebung definieren, mit
% der Beispiele automatisch gesetzt werden können.

The following example shows some possibilities to format the axis labels and the
tick labels. The example is not intended to be pretty nor useful in any other
way than just showing some labels. More examples of customized tick labels are listed in Sec.~\ref{sec:CustomTickLabels}.

\input{examples/LabelsNTickLabels}

\lstinputlisting{examples/LabelsNTickLabels.tex}




\subsection{Coordinate Systems}

This section should just give some hints how to use the different coordinate
systems.

A new plot is created with the environment
\texttt{NumericDataPlot}. The options are illustrated in the following example.

Consider the plot drawn below which is defined by the following code. Note that the example parameters deviate from the standard values to clarify the general possibilities. 

\begin{minipage}[T]{0.5\linewidth}
	\begin{verbatim}
	\begin{NumericDataPlot}
 [xPicMin=300, xPicMax=700, yPicMin=200, yPicMax=700,
	  llx=2cm, lly=1.5cm, urx=1cm, ury=1cm]
	   {8cm}{6.5cm}
...
% some axes and stuff
	...
	\end{NumericDataPlot}
	\end{verbatim}
\end{minipage}

The total width and total height of the plot object are set with the mandatory arguments of \texttt{NumericDataPlot}. These dimensions define the bounding box of the plot object (dashed box in the plot below), as it is seen by the \TeX~interpreter\footnote{Because the elements inside a \texttt{NumericDataPlot} environment are set relative to an internal coordinate system, content may be placed outside the bounding box and may overlap with surrounding elements.}. The internal, dimensionless coordinate system, in which the actual axes will be placed, is defined by the optional xPicMin, xPicMax, yPicMin and yPicMax values. The location of the horizontal and vertical axes x=xPicMin, x=xPicMax, and y=yPicMin, y=yPicMax, respectively, relative to the bounding box is controlled by the padding values llx, lly, urx and ury. Thus, the actual length Wx of the range xPicMax-xPicMin on the page is calculated by
\begin{align*}
\mathrm{Wx} = \mathrm{total\ width} - \mathrm{llx} - \mathrm{urx},
\end{align*}
and alike for the y direction. Obviously, the padding values should be positive.

The standard values of the padding values are chosen such that single line axis labels and 3-4 digit tick labels should be within the bounding box.

\vspace{1cm}

\begin{center}
\psframebox[framesep=0pt,boxsep=false,linestyle=dashed]{%
	\begin{NumericDataPlot}
	   [xPicMin=300, xPicMax=700, yPicMin=200, yPicMax=700,
	  llx=2cm, lly=1.5cm, urx=1cm, ury=1cm]
	   {8cm}{6.5cm}
	   
	   \psline(300,200)(700,200)(700,700)(300,700)(300,200)
	   \pnode(300,200){PicLL}
	   \pnode(700,200){PicLR}
	   \pnode(700,700){PicUR}
	   \pnode(300,700){PicUL}
	   \rput(200,100){\Rnode{CapLL}{(xPicMin, yPicMin)}}
	   \ncline{->}{CapLL}{PicLL}
	   \rput(800,100){\Rnode{CapLR}{(xPicMax, yPicMin)}}
	   \ncline{->}{CapLR}{PicLR}
	   \rput(800,800){\Rnode{CapUR}{(xPicMax, yPicMax)}}
	   \ncline{->}{CapUR}{PicUR}
	   \rput(200,800){\Rnode{CapUL}{(xPicMin, yPicMax)}}
	   	\ncline{->}{CapUL}{PicUL}
	   	
	   % 	\pnode(400,400){PlotLL}
	   % \pnode(600,400){PlotLR}
	   % \pnode(600,600){PlotUR}
	   % \pnode(400,600){PlotUL}
	   % \rput(350,300){\Rnode{PCapLL}{(xCoordMin, yCoordMin)}}
	   % \ncline{->}{PCapLL}{PlotLL}
	   % \rput(800,450){\Rnode{PCapLR}{(xCoordMax, yCoordMin)}}
	   % \ncline{->}{PCapLR}{PlotLR}
	   % \rput(800,650){\Rnode{PCapUR}{(xCoordMax, yCoordMax)}}
	   % \ncline{->}{PCapUR}{PlotUR}
	   % \rput(500,870){\Rnode{PCapUL}{(xCoordMin, yCoordMax)}}
	   % 	\ncline{->}{PCapUL}{PlotUL}
	   
	   	\rput(140,350){\pnode{LLXA}}
	   	\rput(300,350){\pnode{LLXB}}
	   	\ncline{<->}{LLXA}{LLXB}
	   	\naput{llx}

		\rput(350,200){\pnode{LLXA}}
	    \rput(350,12.5){\pnode{LLXB}}
	    \ncline{<->}{LLXA}{LLXB}
	    \naput{lly}
	    
	    \rput(780,350){\pnode{URXA}}
	   	\rput(700,350){\pnode{URXB}}
	   	\ncline{<->}{URXA}{URXB}
	   	\naput{urx}

		\rput(350,825){\pnode{URXA}}
	    \rput(350,700){\pnode{URXB}}
	    \ncline{<->}{URXA}{URXB}
	    \naput{ury}
	    
	   \rput(795,825){\pnode{HU}}
	   \rput(795,12.5){\pnode{HL}} 
           \ncline{<->}{HL}{HU}
	    \nbput[nrot=:U]{total height}
            
\rput(140,-6.25){\pnode{WU}}
	   \rput(780,-6.25){\pnode{WL}} 
           \ncline{<->}{WU}{WL}
	    \nbput[nrot=:U]{total width}
	
	% \setxAxis{xCoordMin=400, xCoordMax=600,
	% 	   xMin=1, xMax=1.6, Dx=0.2}
	% 	\setyAxis
	% 	   {yCoordMin=400, yCoordMax=600,
	% 	   yMin=50, yMax=150, Dy=25}
		
	%	\plotxAxis[NoLabel]{}
	%	\plotyAxis[NoLabel]{}
		
	%	\listplot[style=StdLineStyA]{\IdentI}
	\end{NumericDataPlot}}
	
\end{center}

In the next example, the placement of multiple axes in the internal coordinate frame is illustrated. The coordinate frame settings are the same as above, but standard padding values are used.

\begin{verbatim}
	\begin{NumericDataPlot}
	   [xPicMin=300, xPicMax=700, yPicMin=200, yPicMax=700]
	   {0.8\textwidth}{7cm}

% set and draw 1. (lower) axes
\setxAxis{xCoordMin=300, xCoordMax=600, xMin=1, xMax=1.6, Dx=0.2}
 \setyAxis{yCoordMin=200, yCoordMax=400, yMin=50, yMax=150, Dy=25}

\plotxAxis{x-label}
\plotyAxis{y-label}

\listplot[style=StdLineStyA]{\IdentI}
	    
% set and draw 2. (upper) axes
\setxAxis{xCoordMin=400, xCoordMax=700, xMin=1, xMax=1.6, Dx=0.2}
\setyAxis{yCoordMin=450, yCoordMax=700, yMin=50, yMax=150, Dy=25}
		
\plotxAxis[NoLabel]{}
\plotyAxis[NoLabel]{}

\listplot[style=StdLineStyA]{\IdentI}

\end{NumericDataPlot}
\end{verbatim}

\begin{center}
\psframebox[framesep=0pt,boxsep=false,linestyle=dashed]{%
	\begin{NumericDataPlot}%
	   [xPicMin=300, xPicMax=700, yPicMin=200, yPicMax=700]
	   {8cm}{7cm}
	   
		\psline(300,200)(700,200)(700,700)(300,700)(300,200) \pnode(300,200){PicLL}
		\pnode(700,200){PicLR} \pnode(700,700){PicUR} \pnode(300,700){PicUL}
		\rput(250,80){\Rnode{CapLL}{(xPicMin, yPicMin)}}
	   	\ncline{->}{CapLL}{PicLL}
		\rput(750,80){\Rnode{CapLR}{(xPicMax, yPicMin)}}
	   	\ncline{->}{CapLR}{PicLR}
		\rput(750,750){\Rnode{CapUR}{(xPicMax, yPicMax)}}
	   	\ncline{->}{CapUR}{PicUR}
		\rput(250,750){\Rnode{CapUL}{(xPicMin, yPicMax)}}
	   	\ncline{->}{CapUL}{PicUL}

		\pnode(300,200){PlotLL} \pnode(600,400){PlotUR}
		\rput[l](325,235){\Rnode{PCapLL}{(xCoordMin$_{1}$, yCoordMin$_{1}$)}}
	   	\ncline{->}{PCapLL}{PlotLL}
		\rput(500,365){\Rnode{PCapUR}{(xCoordMax$_{1}$, yCoordMax$_{1}$)}}
	   	\ncline{->}{PCapUR}{PlotUR}

 		\pnode(400,450){PlotLL}
		\pnode(700,700){PlotUR} \rput[l](425,485){\Rnode{PCapLL}{(xCoordMin$_{2}$,yCoordMin$_{2}$)}}
	   	\ncline{->}{PCapLL}{PlotLL}
		\rput[r](675,665){\Rnode{PCapUR}{(xCoordMax$_{2}$, yCoordMax$_{2}$)}}
	   	\ncline{->}{PCapUR}{PlotUR}


		\setxAxis{xCoordMin=300, xCoordMax=600, xMin=1, xMax=1.6, Dx=0.2}
	 	\setyAxis{yCoordMin=200, yCoordMax=400, yMin=50, yMax=150, Dy=25}
		\plotxAxis{x-label $gj$}
        \plotyAxis{y-label $\hat{E}$}
	
		\listplot[style=StdLineStyA]{\IdentI}
	    
	   	   
		\setxAxis{xCoordMin=400, xCoordMax=700,
		   xMin=1, xMax=1.6, Dx=0.2}
		\setyAxis{yCoordMin=450, yCoordMax=700,
		   yMin=50, yMax=150, Dy=25}
		
		\plotxAxis[NoLabel]{}
		\plotyAxis[NoLabel]{}
		
		\listplot[style=StdLineStyA]{\IdentI}
	
	\end{NumericDataPlot}
	}
\end{center}


\subsection{Undistorted plot}

To get an undistorted plot, the following example may be helpful. The width $w$ of
the graphic is set manually. The calculation of the total height $h$ is
\begin{align*}
	h &=\left(\frac{yMax-yMin}{xMax-xMin}\right)
		\left(\frac{xCoordMax-xCoordMin}{yCoordMax-yCoordMin}\right)\\
 &\hphantom{=} \qquad \left(\frac{yPicMax-yPicMin}{xPicMax-yPicMin}\right)\left(
		w-llx-urx
		\right)	 + lly + ury,
\intertext{which simplifies for default values ($xCoordMax=yCoordMax=xPicMax=yPicMax=1000$, $xCoordMin=yCoordMin=xPicMin=yPicMin=0$) to}
 	h &=\left(\frac{yMax-yMin}{xMax-xMin}\right)
		\left(
		w-llx-urx
		\right)	 + lly + ury
\end{align*}


\input{examples/data_Nyquist}

\input{examples/NyquistPlot}
\lstinputlisting[firstline=2,lastline=22]{examples/NyquistPlot.tex}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "NumericPlotsDoc"
%%% End: