def plotPanelScreenshot(panel, filename):
    """Capture a screenshot of the contents of the given :class:`.PlotPanel`
    or :class:`.PlotPanel`, saving it to the given ``filename``.
    """
    panel.getFigure().savefig(filename)
