Rishikesh Kumar Rishi has Published 1016 Articles

How to change the default path for "save the figure" in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:06:03

5K+ Views

To change the default path for "save the figure", we can use rcParams["savefig.directory"] to set the directory path.StepsSet the figure size and adjust the padding between and around the subplots.Create random data using numpy.Use imshow() method. Display the data as an image, i.e., on a 2D regular raster.Save the figure ... Read More

How to have actual values in Matplotlib Pie Chart displayed?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:05:32

7K+ Views

To have actual or any custom values in Matplotlib pie chart displayed, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make lists of labels, fractions, explode position and get the sum of fractions to calculate the percentageMake a pie chart ... Read More

How to plot MFCC in Python using Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:04:39

1K+ Views

To plot MFCC in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Open and read a WAV file.Compute MFCC features from an audio signal.Create a figure and a set of subplots.Interchange two axes of an arrayDisplay the data as ... Read More

How can I convert from scatter size to data coordinates in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:03:56

350 Views

To convert from scatter size to data coordinates in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x and s data points using numpy.Create a figure and a set of subplots.Make a scatter plot with X and s, ... Read More

How to load a .ttf file in Matplotlib using mpl.rcParams?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:02:13

524 Views

To load a .ttf file in Matplotlib using mpl.rcParams, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Initialize the path for the .ttf file.Get an instance of a class for storing and manipulating the font properties.Set the font family with ... Read More

Scroll backwards and forwards through Matplotlib plots

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:01:51

2K+ Views

To scroll backward and forwards (left and right keys) through Matplotlib plots, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create curr_pos and y using numpy.Create a new figure or activate an existing figure using figure() method.Bind the function to ... Read More

How to increase the thickness of error line in a Matplotlib bar chart?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:00:56

1K+ Views

To increase the thickness of error line in a Matplotlib bar chart, we can use err_kw=dict() with their properties.StepsSet the figure size and adjust the padding between and around the subplots.Make a dictionary of bar details.Create a figure and a set of subplots.Use bar() method to make a bar plot ... Read More

How to plot a time series array, with confidence intervals displayed in Python? (Matplotlib)

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 12:00:25

3K+ Views

To plot a time series array, with confidence intervals displayed in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Get the time series array.Initialize a variable, n_steps, to get the mean and standard deviation.Get the under and above lines ... Read More

How to plot a watermark image in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:59:44

1K+ Views

To plot a watermark image in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Return a sample data file using get_sample_data() method.Create a figure and a set of subplots.Plot the data points using plot() method, with alpha=0.7 and marker ... Read More

Different X and Y scales in zoomed inset in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 17-Jun-2021 11:59:19

1K+ Views

To show different X and Y scales in zoomed inset in Matplotlib, we can use inset_axes() method.StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Add a subplot to the current figure.Plot x and y data points using plot() method.Create ... Read More

Advertisements