This article reprinted from https://www.it610.com/article/1282212275846922240.htm
if you have offended, please contact me
I looked for Matplotlib button for a long time before I found something I could understand. I don’t know if it was too simple, so no one wrote it.
ttonAxe = PLT.axes ([0.94, 0.03, 0.03, 0.03])
u>to set the position of the button.
tton1 = Button(buttonAxe, 'p2',color='khaki', overcolor='yellow')
i>ed to create the Button and to set the color and the color of the Button when the mouse is over the Button.
third line tton1.on_clicked (show2)
s>the function triggered after the button is clicked.
in addition to write after click the button to trigger functions should pay attention to write the event in the brackets, such as def show2 (event) :
buttonaxe = plt.axes([0.94, 0.03, 0.03, 0.03])
button1 = Button(buttonaxe, 'p2',color='khaki', hovercolor='yellow')
button1.on_clicked(show2)
Read More:
- Win10, add sublime text in the right mouse button menu to open
- Sublime text add to right mouse button function
- Python — using Matplotlib to draw histogram
- [Android] button uses the custom drawable file to set the background, and runs “error inflating class button”
- Error in installing Matplotlib Library: permissionerror: [errno 13] permission denied: ‘/ usr / local / lib / python3.6’
- Python Anaconda Spyder can’t display pictures by using Matplotlib. Error report solution: figures now render in the plots pane by default. To mak
- matplotlib 1.3.1 requires nose, which is not installed. matplotlib 1.3.1 requires tornado, which is
- Regarding [java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean], combined with examples
- PHP in Windows combined with bat batch processing to achieve multi process verification proxy server function
- Python idle add configuration shortcut (Ctrl + L)
- Beef combined with Metasploit under Kali
- Deploy mongodb fragment combined with replica set to realize distributed storage of MySQL database files (step 10)
- Add Samba user prompt failed to add entry for user
- Solution to the problem that the toolbar menu button cannot be clicked
- Add samba user prompt Failed to add entry for user.
- MySQL failed to add foreign key: SQL 1452 cannot add or update a child row:a foreign key constraint fails
- How to center your HTML button itself? ——Use the align attribute of center or Div
- Solving attributeerror: module ‘Matplotlib’ has no attribute ‘artist’
- Click the button to jump to a new window
- Solving attributeerror: module ‘Matplotlib’ has no attribute ‘plot‘