Rishikesh Kumar Rishi has Published 1156 Articles

How to plot categorical variables in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:16:54

4K+ Views

To plot categorical variables in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a dictionary with some details.Extract the keys and values from the dictionary (Step 2).Create a figure and a set of subplots.Plot bar, scatter and plot ... Read More

Plot curves in fivethirtyeight stylesheet in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:13:40

512 Views

To use fivethirtyeight stylesheet, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.To use fivethirtyeight, we can use plt.style.use() method.Create x data points using numpy.Create a figure and a set of subplots using subplots() method.Plot three curves using plot() method.Set ... Read More

Adding a line to a scatter plot using Python's Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:11:11

17K+ Views

To add a line to a scatter plot using Python's 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 number of data points.Plot x and y data points using scatter() method.Plot a line using plot() ... Read More

How to disable the keyboard shortcuts in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:10:54

653 Views

To disable the keyboard shortcuts in Matplotlib, we can use remove('s') method.StepsSet the figure size and adjust the padding between and around the subplots.To disable the shortcut "s" to save the figure, use remove("s") method.Initialize a variable n for number of data points.Create x and y data points using numpyPlot ... Read More

How can I set the location of minor ticks in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:09:09

6K+ Views

To set the location of the minor ticks in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Create a figure and a set of subplots.Plot x and y data points using plot() ... Read More

How to label and change the scale of a Seaborn kdeplot's axes? (Matplotlib)

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:08:50

2K+ Views

To label and change the scale of a Seaborn kdeplot's axes, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create random data points using numpy.Plot Kernel Density Estimate (KDE) using kdeplot() method.Set Y-axis tscale and label.To display the figure, use ... Read More

How to make a broken horizontal bar plot in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:08:34

813 Views

We can take the following steps to make a broken bar plot, Set the figure size and adjust the padding between and around the subplots.Create a figure and a set of subplots.Plot a horizontal sequence of rectangles.Set x and y axes scale, X-axis label, Y ticks and Y tick labels.Configure ... Read More

How to update the plot title with Matplotlib using animation?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:08:03

3K+ Views

To update the plot title with Matplotlib using 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 using figure() method.Create x and y data points using numpy.Get the current axis.Add text ... Read More

Colouring the edges by weight in networkx (Matplotlib)

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:03:59

3K+ Views

To color the edges by weight in networkx, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Initialize a graph with edges, name, or graph attributes.Add nodes to the current graph.Add edges to the current graph's nodes.Iterate the given graph's edges ... Read More

Plotting animated quivers in Python using Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 09-Jun-2021 12:03:35

3K+ Views

To animate quivers in Python, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Create u and v data points using numpy.Create a figure and a set of subplots.Plot a 2D field of arrows ... Read More

Advertisements