![]() # gradient_fill(*generate_data(100), zfunc=None) # original ![]() For example, to make the lines have an evenly blurred underside, youĬould use PIL to build an alpha layer which is 1 near the line and 0 near the bottom edge. His method opens to door to many gradient/blur/drop-shadowĮffects. Please note Joe Kington deserves the lion's share of the credit here my sole contribution is zfunc. Xy = np.vstack(, xy,, ])Ĭlip_path = Polygon(xy, facecolor='none', edgecolor='none', closed=True) Im = ax.imshow(z, aspect='auto', extent=, The transparent gradient clipped to just the area beneath the curve. If None, the current pyplot axes will be used.Īdditional arguments are passed on to matplotlib's ``plot`` function. If None, the color of the line will be used. Plot a line with a linear alpha gradient filled beneath it.įill_color : a matplotlib color specifier (string, tuple) or None It's a touch more work, but there's a method that draws much faster and gives a better visual result: Set the clip path of an image plotted with imshow.ĭef gradient_fill(x, y, fill_color=None, ax=None, **kwargs): pcolormesh is fairly slow to draw and isn't smoothly interpolated. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |