Matplotlib hatching with circles: How to suppress display of "truncated" circles?

249 Views Asked by At

By default, Matplotlib "clips" or "truncates" circles (or other symbols) displayed as hatch overlay, as illustrated in the example figure created with this code.

import numpy as np
from matplotlib import pyplot as plt
n = 20
sig = np.ma.masked_greater(np.random.rand(n,n), 0.25)
f, ax1 = plt.subplots(1,1, figsize=(4,4))
ax1.pcolor(sig, hatch="o", alpha=0)

matplotlib hatching example with truncated circles

I understand why this is so, but in some of my applications, I would like to solely display "untruncated" symbols. In the below example, I tried ax1.pcolor(sig, hatch="o", alpha=0, clip_on=False), but it has no effect.

How is this possible? And: I there any option to control that "truncated" symbols are either (a) not shown at all or (b) as complete symbols?

0

There are 0 best solutions below