summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib/pst-fit/doc/pst-fit-doc.tex
blob: a61092a524778a680fd57b0c97de470e8d5668fa (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
%% $Id: pst-fit-doc.tex 673 2012-04-01 09:50:48Z herbert $
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,
   smallheadings, headexclude,footexclude,oneside]{pst-doc}
\usepackage[utf8]{inputenc}
\usepackage{pst-fit}
\let\pstFitFV\fileversion

\usepackage{biblatex}
\addbibresource{\jobname.bib}

\input{pst-fit-doc.data}
\readdata[ignoreLines=0]{\Gauss}{gauss.dat}
\readdata[ignoreLines=0]{\Power}{power.dat}
\readdata[ignoreLines=0]{\King}{king.dat}
\readdata[ignoreLines=0]{\Exp}{exp.dat}
\readdata[ignoreLines=0]{\Linear}{linear.dat}
\readdata[ignoreLines=0]{\LinearA}{linearA.dat}
\readdata[ignoreLines=0]{\Recip}{recip.dat}
\readdata[ignoreLines=0]{\Poly}{poly.dat}
\readdata[ignoreLines=0]{\Logt}{logt.dat}
\readdata[ignoreLines=0]{\Loge}{loge.dat}


\renewcommand\bgImage{%
\begin{psgraph}[arrows=<->,Dy=20](0,0)(0,0)(10,100){2in}{2in}
\listplot[decimals=2,EqPos=5 50,plotstyle=GLLSR,RecipFit,linestyle=dashed]{\Recip}
\listplot[plotstyle=dots]{\Recip}
\end{psgraph}
}

\let\Section\section
\def\section{\clearpage\Section}
\begin{document}

\title{\texttt{pst-fit}}
\subtitle{Curve fitting; v.\pstFitFV}
\author{Buddy Ledger\\
Herbert Voß}
\docauthor{}
\date{\today}
\maketitle

\tableofcontents
%
%
%
\psset{xAxisLabel=x, %Setup for psgraph env
        yAxisLabel=y,
        xAxisLabelPos=,
        yAxisLabelPos=,
        lly=-1cm,llx=-1cm}

\section{Fit of Linear Function}
%Replaces LSM using default options

\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dy=2](0,0)(0,0)(10,22){4.5in}{4.5in}
\listplot[decimals=2,EqPos=3 15,plotstyle=GLLSR,linestyle=dashed]{\Linear}
\listplot[plotstyle=dots,linecolor=red,dotscale=2,dotstyle=x]{\Linear}
\end{psgraph}
\end{LTXexample}

\section{Fit of Power Function}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dy=100](0,0)(0,0)(10,1000){4.5in}{4.5in}
\listplot[decimals=2,EqPos=1 800,linestyle=dashed,plotstyle=GLLSR,PowerFit]{\Power}
\listplot[plotstyle=dots,linecolor=red,dotscale=2,dotstyle=x]{\Power}
\listplot[EqPos=5 4,plotstyle=GLLSR,linecolor=blue,CustomFit,CheckZeroX,CheckZeroY,FYtrans=log,RYtrans=10 exch exp,FXtrans=log]{\Power}
\end{psgraph}
\end{LTXexample}

\section{Fit of exp Function}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dx=1,Dy=1000,xsubticks=1,ysubticks=1](0,0)(0,0)(10,10000){4.5in}{4.5in}
\listplot[PstDebug=1,decimals=2,EqPos=4 2000,MaPos=5 7000,plotstyle=GLLSR,ExpFit]{\Exp}
\listplot[plotstyle=dots]{\Exp}
\end{psgraph}
\end{LTXexample}

\section{Fit of Log10/Loge Functions}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dx=1,Dy=2,xsubticks=1,ysubticks=1](0,0)(0,0)(10,50){4.5in}{4.5in}
\listplot[decimals=2,EqPos=5 10,plotstyle=GLLSR,LogTFit]{\Logt}
\listplot[decimals=2,plotstyle=dots]{\Logt}
\listplot[decimals=2,EqPos=5 28,plotstyle=GLLSR,LogEFit]{\Loge}
\listplot[decimals=2,plotstyle=dots]{\Loge}
%\listplot[EqPos=5 4,plotstyle=GLLSR,CustomFit,CheckZeroX=true,CheckZeroY=true,FYtrans=Yint dup mul sub %log,RYtrans=10 exch exp Yint dup mul add,FXtrans=log]{\Linear}
\end{psgraph}
\end{LTXexample}



\section{Fit of Recip}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=<->,Dx=1,Dy=10,xsubticks=1,ysubticks=1](0,0)(0,0)(10,100){4.5in}{4.5in}
\listplot[decimals=2,EqPos=5 2,plotstyle=GLLSR,RecipFit]{\Recip}
\listplot[plotstyle=dots]{\Recip}
\end{psgraph}
\end{LTXexample}

\section{Fit of Kings Law data}

\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(10,20){4.5in}{4.5in}
\pstScalePoints(1,1){}{dup mul}
\listplot[decimals=2,EqPos=5 2,plotstyle=GLLSR,PowerFit,Yint=5]{\King}
\listplot[plotstyle=dots]{\King}
\pstScalePoints(1,1){}{}
\end{psgraph}
\end{LTXexample}

\section{Fit of Guassian}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dx=1,Dy=0.1,xsubticks=1,ysubticks=1](0,0)(-10,0)(10,1){4.5in}{4.5in}
\listplot[plotstyle=dots]{\Gauss}
\listplot[decimals=2,EqPos=5 0.4,plotstyle=GLLSR,GaussFit,plotpoints=400]{\Gauss}
\end{psgraph}
\end{LTXexample}

\section{Fit of 4th Order Polynomial}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dx=1,Dy=100,xsubticks=1,ysubticks=1](0,0)(0,-600)(10,600){4.5in}{4.5in}
\listplot[plotstyle=dots]{\Poly}
%note that the valuewidth needs to be large for debugging matrices
\listplot[valuewidth=20,PstDebug=1,decimals=2,EqPos=0.5 -200,plotstyle=GLLSR,MaPos=7 500,MaScale=0.5,PolyOrder=4,plotpoints=400,Yint=500]{\Poly}
\listplot[linestyle=dashed,decimals=2,EqPos=0.5 -400,plotstyle=GLLSR,PolyOrder=4,plotpoints=400]{\Poly}
%\listplot[decimals=2,EqPos=0.5 -200,plotstyle=GLLSR,PolyOrder=10,plotpoints=400]{\Power}
\end{psgraph}
\end{LTXexample}

\section{LinetoXAxis respects scalepoints.}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=<->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(10,10){4in}{4in}
\pstScalePoints(0.5,0.25){2 add}{16 add}
\listplot[plotstyle=line]{\Linear}
\listplot[arrows=<-,plotstyle=LineToXAxis]{\Linear}
\pstScalePoints(1,1){}{}
\rput[lb](1,2){Scaled fluid velocity distribution on a plot of the physical system.}
\end{psgraph}
\end{LTXexample}

\section{Prepare Points Modification}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(15,30){4.5in}{4.5in}
\listplot[plotstyle=line,plotNoMax=2,plotNo=1]{\LinearA}
\listplot[plotstyle=line,plotNoMax=2,plotNo=2]{\LinearA}
\listplot[plotstyle=line,linestyle=dashed,plotNoMax=2,plotNo=1,plotNoTwo=2,plotNoTwoFunc=add 2 div]{\LinearA}
\rput[lb](10,18){1st Column}
\rput[lb](10,29){2nd Column}
\rput[lb](10,24){Average of 1st and 2nd Columns}
\end{psgraph}
\end{LTXexample}

\section{PrintCoor Demo}
\begin{LTXexample}[pos=t]
\begin{psgraph}[arrows=->,Dx=1,Dy=1,xsubticks=1,ysubticks=1](0,0)(0,0)(10,15){4.5in}{4.5in}
%PrintCoor Demo
\psset{xEnd=,xStart=,decimals=2,valuewidth=50,fontscale=10,PstDebug=1}
\pstScalePoints(1,1){0.75 mul}{0.5 exp 3 mul}
\listplot[plotstyle=PrintCoor,plotNoMax=1,plotNo=1,PstDebug=0,relxerr=0,relyerr=0.1]{\Linear}
\listplot[plotstyle=dots,plotNoMax=1,plotNo=1]{\Linear}
\pstScalePoints(1,1){}{}
\end{psgraph}
\end{LTXexample}

\clearpage
\section{List of all optional arguments for \texttt{pst-fit}}

\xkvview{family=pst-fit,columns={key,type,default}}




\bgroup
\raggedright
\nocite{*}
\printbibliography
\egroup

\printindex





\end{document}