12
12
# See LICENSE.txt for license information.
13
13
#
14
14
##############################################################################
15
- """Collection of plotting functions for PDFs."""
15
+ """Collection of plotting functions (originally specifically) for PDFs."""
16
16
17
17
import matplotlib .pyplot as plt
18
18
import numpy
23
23
24
24
# FIXME - make this return the figure object in the future, so several views
25
25
# can be composed.
26
- def plotPDFs (pairlist , labels = None , offset = "auto" , rmin = None , rmax = None ):
27
- """Plots several PDFs on top of one another.
26
+ def plot_funcs (pairlist , labels = None , offset = "auto" , rmin = None , rmax = None ):
27
+ """Plots several functions g(r) on top of one another.
28
28
29
29
Parameters
30
30
----------
@@ -34,15 +34,15 @@ def plotPDFs(pairlist, labels=None, offset="auto", rmin=None, rmax=None):
34
34
Iterable of names for the pairs. If this is not the same length as
35
35
the pairlist, a legend will not be shown (default []).
36
36
offset
37
- Offset to place between plots. PDFs will be sequentially shifted in
38
- the y-direction by the offset. If offset is 'auto' (default), the
37
+ Offset to place between plots. Functions will be sequentially shifted
38
+ in the y-direction by the offset. If offset is 'auto' (default), the
39
39
optimal offset will be determined automatically.
40
40
rmin
41
41
The minimum r-value to plot. If this is None (default), the lower
42
- bound of the PDF is not altered.
42
+ bound of the function is not altered.
43
43
rmax
44
44
The maximum r-value to plot. If this is None (default), the upper
45
- bound of the PDF is not altered.
45
+ bound of the function is not altered.
46
46
"""
47
47
if labels is None :
48
48
labels = []
@@ -68,7 +68,7 @@ def plotPDFs(pairlist, labels=None, offset="auto", rmin=None, rmax=None):
68
68
return
69
69
70
70
71
- def comparePDFs (
71
+ def compare_funcs (
72
72
pairlist ,
73
73
labels = None ,
74
74
rmin = None ,
@@ -80,10 +80,10 @@ def comparePDFs(
80
80
legend = True ,
81
81
l_width = 1.5 ,
82
82
):
83
- """Plot two PDFs on top of each other and difference curve.
83
+ """Plot two functions g(r) on top of each other and difference curve.
84
84
85
- The second PDF will be shown as blue circles below and the first as a red
86
- line. The difference curve will be in green and offset for clarity.
85
+ The second function will be shown as blue circles below and the first as
86
+ a red line. The difference curve will be in green and offset for clarity.
87
87
88
88
Parameters
89
89
----------
@@ -94,10 +94,10 @@ def comparePDFs(
94
94
the pairlist, a legend will not be shown (default []).
95
95
rmin
96
96
The minimum r-value to plot. If this is None (default), the lower
97
- bound of the PDF is not altered.
97
+ bound of the function is not altered.
98
98
rmax
99
99
The maximum r-value to plot. If this is None (default), the upper
100
- bound of the PDF is not altered.
100
+ bound of the function is not altered.
101
101
show
102
102
Show the plot (default True)
103
103
maglim
@@ -158,7 +158,7 @@ def comparePDFs(
158
158
offset = - 1.1 * (ymax - ymin )
159
159
160
160
# Scale the x-limit based on the r-extent of the signal. This gives a nice
161
- # density of PDF peaks.
161
+ # density of function peaks.
162
162
rlim = rvmax - rvmin
163
163
scale = rlim / 25.0
164
164
# Set a reasonable minimum of .8 and maximum of 1
@@ -305,21 +305,21 @@ def plot_param(target_labels, param_list, param_name=None, field=None):
305
305
return
306
306
307
307
308
- def truncatePDFs (r , gr , rmin = None , rmax = None ):
309
- """Truncate a PDF to specified bounds.
308
+ def truncate_func (r , gr , rmin = None , rmax = None ):
309
+ """Truncate a function g(r) to specified bounds.
310
310
311
311
Parameters
312
312
----------
313
313
r
314
- r-values of the PDF .
314
+ The r-values of the function g(r) .
315
315
gr
316
- PDF g(r) values.
316
+ Function g(r) values.
317
317
rmin
318
318
The minimum r-value. If this is None (default), the lower bound of
319
- the PDF is not altered.
319
+ the function is not altered.
320
320
rmax
321
321
The maximum r-value. If this is None (default), the upper bound of
322
- the PDF is not altered.
322
+ the function is not altered.
323
323
324
324
Returns
325
325
-------
@@ -340,7 +340,7 @@ def truncatePDFs(r, gr, rmin=None, rmax=None):
340
340
341
341
342
342
def _find_offset (pairlist ):
343
- """Find an optimal offset between PDFs ."""
343
+ """Find an optimal offset between functions ."""
344
344
maxlist = [max (p [1 ]) for p in pairlist ]
345
345
minlist = [min (p [1 ]) for p in pairlist ]
346
346
difflist = numpy .subtract (maxlist [:- 1 ], minlist [1 :])
0 commit comments