Python custom simple graph axis simple instance, python custom
Simple axis definition:
Import numpy as npimport matplotlib. pyplot as plt
Create a simple matplotlib instance:
Fig = plt. figure () rect = fig. patch # a rectangle instancerect. set_facecolor ('lightgoldenrodyellow') ax1 = fig. add_axes ([0.1, 0.3, 0.4, 0.4]) rect = ax1.patchrect. set_facecolor ('lightslateegray') for label in ax1.xaxis. get_ticklabels (): # label is a Text instance label. set_color ('red') label. set_rotation (45) label. set_fontsize (16) for line in ax1.yaxis. get_ticklines (): # line is a Line2D instance line. set_color ('green') line. set_markersize (25) line. set_markeredgewidth (3) plt. show ()
Effect display:
Script running time: (0 minutes 0.021 seconds)
Summary
The above is all the content of this article on Python custom simple graph axis simple instance, I hope to help you. If you are interested, you can continue to refer to other related topics on this site. If you have any shortcomings, please leave a message. Thank you for your support!