Alphabetical list Categories
phatch Hatch a polygonal patch in paper space
Call signature:

phatch(xx, yy, pattern='|', angle=0, spacing=10, offset=0)

Help text:

patch(xx, yy, angle) hatches a polygon with vertices at (xx,yy) using the given pattern. pattern is a single character from the following:
  | / - \ : lines at the angle suggested angle
  + x : combination of either orthogonal or diagonal lines
  : * : marks in an orthogonal or hexagonal pattern.
Lines are rendered with the current pen.
Marks are rendereded as by mark, i.e., with the current marker (and pen and brush).
Instead of a pattern, a numeric angle may be specified, clockwise from vertical (in radians, but see degrees).
Optional argument spacing specifies space between lines, in points.
By default, the line pattern is aligned with the center of the polygon.
offset shifts this center by the given number of points.
NaN values in xx or yy may be used to separate multiple polygons to be drawn with common line pattern alignment.
See also hatch.

Example:

import qplot as qp

import numpy as np

qp.figure('phatch', 3, 3)

qp.marker('o', 3)

qp.mark([1, 3], [2, 1])

qp.at(1, 2)

qp.pen('none')

qp.brush('b')

qp.marker('d', 5, 'brush')

qp.phatch([10, 30, 30, 10], [10, 10, 30, 30], pattern=':', spacing=7)

qp.at(3, 1)

qp.pen('r', .5)

qp.phatch([10, 20, 30, 20], [-10, 0, -10, -20], pattern='x', spacing=5)

qp.shrink()

QPlot Documentation — (C) Daniel Wagenaar, 2014–2023