Interactive Electric Field of few point charges with Matplotlib Widgets

Опубликовано: 14 Октябрь 2024
на канале: Pythonika
285
14

Second part of the videolesson about plotting Electric Field with Python is dedicated to creating interactive features to the Electric Field Plot. These real time control features are allowed to modify positions of all point charges, value of the charges and some displaying properties, like line density and field type. Everything was coded with Matplotlib Widgets (Sliders, Radiobuttons and Checkbuttons) in Python
The description of this code and the full working python code you can find here: http://mycoding.uk/a/plotting_of_inte...
For making this tutorial video, I do use the following tips and advises:
How to remove red line in Matplotlib Slider: http://mycoding.uk/a/how_to_remove_re...
How to pass arguments to function called by on_changed in Matplotlib Widgets: http://mycoding.uk/a/how_to_pass_argu...
How to make random Numpy 2D array with different range in every column: http://mycoding.uk/a/how_to_make_rand...
Video content:
0:00 – Introduction
0:05 – Converting old code    • Electric field intensity and Electric...   to a new style
6:33 – Add Matplotlib Sliders to control charge coordinates, charge value and line density
8:36 – Removing annoying red line from sliders
9:57 – Sending function arguments via lambda call of function
11:08 – Matplotlib Checkbuttons to control plots displayed
12:38 – Matplotlib Radiobuttons for simple selector of displayed information
13:47 – Radiobuttons to reassign Sliders to different objects
15:04 – How to disable and enable Sliders automatic update on changes
15:30 – Conclusion and demonstration of Electric Field changed caused by Interactive movement of few point charges with Matplotlib Widgets
#matplotlib #electricfield #pythongraphics