Skip to content

Commit

Permalink
Merge pull request #18 from GregoryAshton/allow-user-to-set-lims
Browse files Browse the repository at this point in the history
Expose the period and pdot lims to the user
  • Loading branch information
mattpitkin authored May 2, 2018
2 parents 55a4e34 + aef9693 commit 33561c2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions psrqpy/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ def __repr__(self):
def ppdot(self, intrinsicpdot=False, excludeGCs=False, showtypes=[], showGCs=False,
showSNRs=False, markertypes={}, deathline=True, deathmodel='Ip', filldeath=True,
filldeathtype={}, showtau=True, brakingidx=3, tau=None, showB=True, Bfield=None,
rcparams={}):
pdotlims=None, periodlims=None, rcparams={}):
"""
Draw a lovely period vs period derivative diagram.
Expand Down Expand Up @@ -774,6 +774,8 @@ def ppdot(self, intrinsicpdot=False, excludeGCs=False, showtypes=[], showGCs=Fal
shows lines for :math:`10^{10}` through to :math:`10^{14}` gauss with steps in
powers of 10.
Bfield (list): a list of magnetic field strengths to plot.
periodlims (array_like): the [min, max] period limits to plot with
pdotlims (array_like): the [min, max] pdot limits to plot with
rcparams (dict): a dictionary of :py:obj:`matplotlib.rcParams` setup parameters for the
plot.
Expand Down Expand Up @@ -901,8 +903,10 @@ def ppdot(self, intrinsicpdot=False, excludeGCs=False, showtypes=[], showGCs=Fal
ax.set_ylabel(r'Period Derivative')

# get limits
periodlims = [10**np.floor(np.min(np.log10(periods))), 10.*int(np.ceil(np.max(pdots)/10.))]
pdotlims = [10**np.floor(np.min(np.log10(pdots))), 10**np.ceil(np.max(np.log10(pdots)))]
if periodlims is None:
periodlims = [10**np.floor(np.min(np.log10(periods))), 10.*int(np.ceil(np.max(pdots)/10.))]
if pdotlims is None:
pdotlims = [10**np.floor(np.min(np.log10(pdots))), 10**np.ceil(np.max(np.log10(pdots)))]
ax.set_xlim(periodlims);
ax.set_ylim(pdotlims);

Expand Down

0 comments on commit 33561c2

Please sign in to comment.