1212# See LICENSE.txt for license information.
1313#
1414##############################################################################
15- """Collection of plotting functions for PDFs."""
15+ """Collection of plotting functions (originally specifically) for PDFs."""
1616
1717import matplotlib .pyplot as plt
1818import numpy
2323
2424# FIXME - make this return the figure object in the future, so several views
2525# 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.
2828
2929 Parameters
3030 ----------
@@ -34,15 +34,15 @@ def plotPDFs(pairlist, labels=None, offset="auto", rmin=None, rmax=None):
3434 Iterable of names for the pairs. If this is not the same length as
3535 the pairlist, a legend will not be shown (default []).
3636 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
3939 optimal offset will be determined automatically.
4040 rmin
4141 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.
4343 rmax
4444 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.
4646 """
4747 if labels is None :
4848 labels = []
@@ -68,7 +68,7 @@ def plotPDFs(pairlist, labels=None, offset="auto", rmin=None, rmax=None):
6868 return
6969
7070
71- def comparePDFs (
71+ def compare_funcs (
7272 pairlist ,
7373 labels = None ,
7474 rmin = None ,
@@ -80,10 +80,10 @@ def comparePDFs(
8080 legend = True ,
8181 l_width = 1.5 ,
8282):
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.
8484
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.
8787
8888 Parameters
8989 ----------
@@ -94,10 +94,10 @@ def comparePDFs(
9494 the pairlist, a legend will not be shown (default []).
9595 rmin
9696 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.
9898 rmax
9999 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.
101101 show
102102 Show the plot (default True)
103103 maglim
@@ -158,7 +158,7 @@ def comparePDFs(
158158 offset = - 1.1 * (ymax - ymin )
159159
160160 # 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.
162162 rlim = rvmax - rvmin
163163 scale = rlim / 25.0
164164 # 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):
305305 return
306306
307307
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.
310310
311311 Parameters
312312 ----------
313313 r
314- r-values of the PDF .
314+ The r-values of the function g(r) .
315315 gr
316- PDF g(r) values.
316+ Function g(r) values.
317317 rmin
318318 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.
320320 rmax
321321 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.
323323
324324 Returns
325325 -------
@@ -340,7 +340,7 @@ def truncatePDFs(r, gr, rmin=None, rmax=None):
340340
341341
342342def _find_offset (pairlist ):
343- """Find an optimal offset between PDFs ."""
343+ """Find an optimal offset between functions ."""
344344 maxlist = [max (p [1 ]) for p in pairlist ]
345345 minlist = [min (p [1 ]) for p in pairlist ]
346346 difflist = numpy .subtract (maxlist [:- 1 ], minlist [1 :])
0 commit comments