'Auxiliary method for `add_section` and `add_figs_to_section`.'

def _add_figs_to_section(self, figs, captions, section='custom', image_format='png', scale=None, comments=None):

    (figs, captions, comments) = self._validate_input(figs, captions, section, comments)
    _check_scale(scale)
    for (fig, caption, comment) in zip(figs, captions, comments):
        caption = ('custom    plot' if (caption == '') else caption)
        sectionvar = self._sectionvars[section]
        global_id = self._get_id()
        div_klass = self._sectionvars[section]
        img_klass = self._sectionvars[section]
        img = _fig_to_img(fig=fig, scale=scale, image_format=image_format)
        html = image_template.substitute(img=img, id=global_id, div_klass=div_klass, img_klass=img_klass, caption=caption, show=True, image_format=image_format, comment=comment)
        self.fnames.append(('%s-#-%s-#-custom' % (caption, sectionvar)))
        self._sectionlabels.append(sectionvar)
        self.html.append(html)
