cortex.quickflat.composite.add_hatch¶
- cortex.quickflat.composite.add_hatch(fig: Axes, hatch_data: Dataview, extents: tuple[float, float, float, float] | None = None, height: int | None = None, hatch_space: int = 4, hatch_color: tuple[int, int, int] = (0, 0, 0), sampler: str = 'nearest', recache: bool = False) AxesImage[source]¶
Add hatching to figure at locations specified in hatch_data
- Parameters:
- figmatplotlib figure
Figure into which to plot the hatches. Should have pycortex flatmap image in it already.
- hatch_datacortex.Volume
cortex.Volume object created from data scaled from 0-1; locations with values of 1 will have hatching overlaid on them in the resulting image.
- extentsarray-like
4 values for [Left, Right, Top, Bottom] extents of image plotted. If None, defaults to extents of images already present in figure.
- heightscalar
Height of image. if None, defaults to height of images already present in figure.
- hatch_spacescalar
Spacing between hatch lines, in pixels
- hatch_color3-tuple
(R, G, B) tuple for color of hatching. Values for R,G,B should be 0-1
- samplerstr
Name of sampling function used to sample underlying volume data. Options include ‘trilinear’,’nearest’,’lanczos’; see functions in cortex.mapper.samplers.py for all options
- recacheboolean
Whether or not to recache intermediate files. Takes longer to plot this way, potentially resolves some errors.
- Returns:
- imgmatplotlib.image.AxesImage
matplotlib axes image object for plotted hatch image
Notes
Possibly to add: add hatch_width, hatch_offset arguments.