matplotlib - ploting filled polygons in python -
my two matrix tri
and face V
(NX 3) And I want to plot the corner of polygon (Mx3). Is there a matplotlib (or an alternative) way to do this? Some similar to the Matlab command
patch ('face', triangular, 'meridian', v, 'face color', 'flat', 'color of edge', 'none', I do not exactly believe what matlab does, and I do not believe in what matlab does, But you can draw a polygon using the one optimized from docs: Import NMP as import matplotlib.pyplot matlotlib.patches from plt import matplotlib.collections as matplotlib Import polygon from import PatchCollection fig, ax = plt.subplots () patch = [] num_sides = 5 (num_polygons) for i in num_polygons = 5 range: polygon = polygon (np.random.rand (num_sides, 2), true) patch .append (Polygon) P = patch clearing (patch, semiplex = matplotlib.mim.jet, alpha = 0.4) color = 100 * np.remand.rend (lane (patch)) p. Set_are (np. Array (color) ax. Add_collection (p) plt.show ()
Comments
Post a Comment