def triangle(self, params=None, query=None, extent=<NUM_LIT>,<EOL>**kwargs):
if triangle is None:<EOL><INDENT>raise ImportError('<STR_LIT>')<EOL><DEDENT>if params is None:<EOL><INDENT>if self.fit_for_distance:<EOL><INDENT>params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>params = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL><DEDENT><DEDENT>df = self.samples<EOL>if query is not None:<EOL><INDENT>df = df.query(query)<EOL><DEDENT>extents = []<EOL>remove = []<EOL>for i,par in enumerate(params):<EOL><INDENT>m = re.search('<STR_LIT>',par)<EOL>if m:<EOL><INDENT>if type(self) == BinaryStarModel:<EOL><INDENT>b = m.group(<NUM_LIT:1>)<EOL>values = (df['<STR_LIT>'.format(b)] - <EOL>df['<STR_LIT>'.format(b)])<EOL>df[par] = values<EOL><DEDENT>else:<EOL><INDENT>remove.append(i)<EOL>continue<EOL><DEDENT><DEDENT>else:<EOL><INDENT>values = df[par]<EOL><DEDENT>qs = np.array([<NUM_LIT:0.5> - <NUM_LIT:0.5>*extent, <NUM_LIT:0.5> + <NUM_LIT:0.5>*extent])<EOL>minval, maxval = values.quantile(qs)<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>datarange = maxval - minval<EOL>if kwargs['<STR_LIT>'][i] < minval:<EOL><INDENT>minval = kwargs['<STR_LIT>'][i] - <NUM_LIT>*datarange<EOL><DEDENT>if kwargs['<STR_LIT>'][i] > maxval:<EOL><INDENT>maxval = kwargs['<STR_LIT>'][i] + <NUM_LIT>*datarange<EOL><DEDENT><DEDENT>extents.append((minval,maxval))<EOL><DEDENT>[params.pop(i) for i in remove]<EOL>fig = triangle.corner(df[params], labels=params, <EOL>extents=extents, **kwargs)<EOL>fig.suptitle(self.name, fontsize=<NUM_LIT>)<EOL>return fig<EOL>
Makes a nifty corner plot.

Uses :func:`triangle.corner`.

:param params: (optional)
    Names of columns (from :attr:`StarModel.samples`)
    to plot.  If ``None``, then it will plot samples
    of the parameters used in the MCMC fit-- that is,
    mass, age, [Fe/H], and optionally distance and A_V.

:param query: (optional)
    Optional query on samples.

:param extent: (optional)
    Will be appropriately passed to :func:`triangle.corner`.

:param **kwargs:
    Additional keyword arguments passed to :func:`triangle.corner`.

:return:
    Figure oject containing corner plot.