MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / get_plot_formats

Function get_plot_formats

lib/matplotlib/sphinxext/plot_directive.py:612–627  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

610
611
612def get_plot_formats(config):
613 default_dpi = {'png': 80, 'hires.png': 200, 'pdf': 200}
614 formats = []
615 plot_formats = config.plot_formats
616 for fmt in plot_formats:
617 if isinstance(fmt, str):
618 if ':' in fmt:
619 suffix, dpi = fmt.split(':')
620 formats.append((str(suffix), int(dpi)))
621 else:
622 formats.append((fmt, default_dpi.get(fmt, 80)))
623 elif isinstance(fmt, (tuple, list)) and len(fmt) == 2:
624 formats.append((str(fmt[0]), int(fmt[1])))
625 else:
626 raise PlotError('invalid image format "%r" in plot_formats' % fmt)
627 return formats
628
629
630def _parse_srcset(entries):

Callers 2

render_figuresFunction · 0.85
runFunction · 0.85

Calls 2

PlotErrorClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…