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

Method pixmap

lib/matplotlib/backends/backend_qt.py:708–719  ·  view source on GitHub ↗

Generate a pixmap for the requested size, mode, and state.

(self, size, mode, state)

Source from the content-addressed store, hash-verified

706 painter.drawPixmap(rect, pixmap)
707
708 def pixmap(self, size, mode, state):
709 """Generate a pixmap for the requested size, mode, and state."""
710 if size.width() <= 0 or size.height() <= 0:
711 return QtGui.QPixmap()
712
713 # Try SVG first, then fall back to PNG
714 svg_path = self.image_path.with_suffix('.svg')
715 if svg_path.exists():
716 pixmap = self._create_pixmap_from_svg(svg_path, size)
717 if not pixmap.isNull():
718 return pixmap
719 return self._create_pixmap_from_png(self.image_path, size)
720
721 def _devicePixelRatio(self):
722 """Return the current device pixel ratio for the toolbar, defaulting to 1."""

Callers 1

paintMethod · 0.95

Calls 4

widthMethod · 0.80
heightMethod · 0.80

Tested by

no test coverage detected