Rishikesh Kumar Rishi has Published 1162 Articles

Creating animated GIF files out of D3.js animations in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Aug-2021 11:56:52

323 Views

To create animated GIF files out of D3.js animation, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a new figure or activate an existing figure.Add an axes to the current figure and make it the current axes.Plot a line ... Read More

How to convert Matplotlib figure to PIL Image object?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Aug-2021 11:55:36

9K+ Views

To convert matplotlib figure to PIL image object, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a new figure or activate an existing figure.Plot a list using plot() method.Initialize the in-memory buffer.Save the buffered image.Use PIL image to get ... Read More

How to draw node colormap in NetworkX/Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Aug-2021 11:54:54

480 Views

To draw node colormap in matplotlib/netwokx, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Return the cycle graph $C_n$ of cyclically connected nodes.Position the nodes on a circle.Draw the graph G with Matplotlib.To display the figure, use show() method.Exampleimport matplotlib.pyplot ... Read More

Set two Matplotlib imshow plots to have the same colormap scale

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Aug-2021 11:40:43

2K+ Views

To set two matplotlib imshow() plots to have the same colormap scale, we can take the followingStepsSet the figure size and adjust the padding between and around the subplots.Create d1 and d2 matrices using Numpy.Get the resultant matrix to get the maximum and minmum value.Use amin and amax methods for ... Read More

Updating the X-axis values using Matplotlib animation

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Aug-2021 11:40:01

1K+ Views

To update the X-axis values using Matplotlib animation, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a figure and a set of subplots.Create x and y data points using numpy.Plot x and y data points using plot method on ... Read More

How to apply a mask on the matrix in Matplotlib imshow?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 13:26:27

2K+ Views

To apply a mask on the matrix in matplotlib imshow(), we can use np.ma.masked_where() method with lower and upper limit.StepsInitialize two variables, l and u, to mask the input matrix.Create random data of 5×5 dimension.Mask the input matrix, lower of l value, and above of u.Create a figure and a ... Read More

How to show the Logarithmic plot of a cumulative distribution function in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 13:22:52

397 Views

To show the Logarithmic plot of a cumulative distribution function in Matplotlib, we can take the following steps.StepsSet the figure size and adjust the padding between and around the subplots.Initialize a variable, N, for number of sample data.Create data, X2 and F2 using numpy.Plot X2 and F2 using plot() method.Make ... Read More

How to visualize scalar 2D data with Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 13:21:09

333 Views

To visualize scalar 2D data with matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Initialize a variable, N, for data samples.Create x and y data points using numpy.Get coordinate matrices from coordinate vectors.Get z data points using numpy.Create a ... Read More

How to use pyplot.arrow or patches.Arrow in matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 13:19:52

622 Views

To use pyplot.arrow or patches.Arrow() in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Initialize four variables, x_tail, y_tail, x_head and y_head.Create a figure and a set of subplots.Get a fancy arrow instance.Add an artist (step 4) using add_patch() ... Read More

How to add black border to matplotlib 2.0 'ax' object In Python 3?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 03-Aug-2021 13:17:02

4K+ Views

To add black border to matplotlib 2.0 'ax' object in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Set axes edgecolor to black.Set axes linewidth to 2.50.Initialize a variable, N, to get the number of sample data.Create x and ... Read More

Advertisements