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

Method check_gc

lib/matplotlib/backends/backend_pdf.py:1887–1912  ·  view source on GitHub ↗
(self, gc, fillcolor=None)

Source from the content-addressed store, hash-verified

1885 self.file.output(*self.gc.finalize())
1886
1887 def check_gc(self, gc, fillcolor=None):
1888 orig_fill = getattr(gc, '_fillcolor', (0., 0., 0.))
1889 gc._fillcolor = fillcolor
1890
1891 orig_alphas = getattr(gc, '_effective_alphas', (1.0, 1.0))
1892
1893 if gc.get_rgb() is None:
1894 # It should not matter what color here since linewidth should be
1895 # 0 unless affected by global settings in rcParams, hence setting
1896 # zero alpha just in case.
1897 gc.set_foreground((0, 0, 0, 0), isRGBA=True)
1898
1899 if gc._forced_alpha:
1900 gc._effective_alphas = (gc._alpha, gc._alpha)
1901 elif fillcolor is None or len(fillcolor) < 4:
1902 gc._effective_alphas = (gc._rgb[3], 1.0)
1903 else:
1904 gc._effective_alphas = (gc._rgb[3], fillcolor[3])
1905
1906 delta = self.gc.delta(gc)
1907 if delta:
1908 self.file.output(*delta)
1909
1910 # Restore gc to avoid unwanted side effects
1911 gc._fillcolor = orig_fill
1912 gc._effective_alphas = orig_alphas
1913
1914 def get_image_magnification(self):
1915 return self.image_dpi/72.0

Callers 8

draw_imageMethod · 0.95
draw_pathMethod · 0.95
draw_path_collectionMethod · 0.95
draw_markersMethod · 0.95
draw_mathtextMethod · 0.95
draw_texMethod · 0.95
draw_textMethod · 0.95

Calls 4

deltaMethod · 0.80
outputMethod · 0.80
get_rgbMethod · 0.45
set_foregroundMethod · 0.45

Tested by

no test coverage detected