Speed up plotting magnified waveforms using Python & Matplotlib.pyplot


We can reduce the calculation time as the orange line in the following figure:


This page shows how to speed up plotting magnified waveforms in matplotlib.
By limiting the data before plotting, we can improve the performance of the matplotlib.
Especially, this method is suitable when the data range for plot is very short compared with the whole data range.

Change the space between labels and lines of the legend in Python Matplotlib.pyplot


The result is:

Legend with changing padding between line and label using handletextpad option

This page how to change the space between the lines in legend and their labels.

Draw electric field lines with changing line color according to the electric potential



The results are:




This page shows how to draw electric force lines around point charges.
The colors of the electric force lines vary according to the electric potential in the point.

Draw flow past cylinder with continuous stream line using Python Matplotlib.pyplot


The result is:


This page shows how to plot air flow past a cylinder with continuous streamline or how to plot vecter field with continuous streamline. The air flow i.e. vecter field is calculated using COMSOL Multiphysics.

Plot continuous magnetic field lines using Python Matplotlib.pyplot


The result is:

Plot continuous magnetic field lines using Python Matplotlib.pyplot

This page introduces how to replot the normal stremplot or stremaline with continuous streamplot or stremline.

Plot electric field lines around a point charge with grounded sphere using Python Matplotlib.pyplot


The result is :


This page shows the method to draw electric field line around a point charge adjecent to a grounded sphere using method of image charges.

Draw electric field lines due to point charges using Python Matplotlib.pyplot


The results are:


and


This code shows how to visualize streamlines with continuous lines using python and matplotlib.pyplot.

When you search "electric field lines python" or something in Google, you would see the images which use the streamplot. Although it is easy way to visualize the direction of the vector fields, electric field must be continuous lines as you know. In this page, electric field lines around the point charges are calculated using scipy.ode (ordinary differential equations) module.

This code is based on following wonderful tips blog posts:



The effect of pad_inches in Python Matplotlib.pyplot


The results are:





This page shows how to change pad_inches and how it affect on the saved figure in python and matplotlib.pyplot.