def star_fill ( ): import matplotlib.pyplot as plt import numpy as np xstar = np.array ( [ \ 0.95, 0.22, -0.95, -0.36, 0.59, 0.36, 0.00, -0.22, -0.59, 0.00 ] ) ystar = np.array ( [ \ 0.31, 0.31, 0.31, -0.12, -0.81, -0.12, 1.00, 0.31, -0.81, -0.38 ] ) # # Add a copy of first point to the end, so the curve closes. # np.append ( xstar, [ 0.95 ] ) np.append ( ystar, [ 0.31 ] ) plt.clf ( ) plt.fill ( xstar, ystar ) filename = 'star_fill.png' plt.savefig ( filename ) plt.show ( ) print ( ' Graphics saved as "' + filename + '"' ) plt.show ( ) plt.close ( ) return if ( __name__ == "__main__" ): star_fill ( )