Rishikesh Kumar Rishi has Published 1156 Articles

Is it possible to use pyplot without DISPLAY?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 05-Jun-2021 07:36:37

864 Views

We can save the current figure in the local machine and can display it.StepsSet the figure size and adjust the padding between and around the subplots.Create x data points using numpy.Plot x and y data points using plot() method.Save the figure using savefig() method.Exampleimport numpy as np import matplotlib.pyplot as ... Read More

How do I display real-time graphs in a simple UI for a Python program?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 13:50:18

836 Views

To display real-time graphs in a simple UI for a Python program, we can animate the contour plot.StepsSet the figure size and adjust the padding between and around the subplots.Create a random data of shape 10×10 dimension.Create a figure and a set of subplots using subplots() method.Make an animation by ... Read More

How to draw a line outside of an axis in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:39:48

3K+ Views

To draw a line (i.e., arrow) outside of an axis, we can use annotate() method, StepsSet the figure size and adjust the padding between and around the subplots.Create a new figure or activate an existing figure using figure() method.Clear the current figure.Add an '~.axes.Axes' to the figure as part of ... Read More

How to use multiple font sizes in one label in Python Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:35:58

955 Views

To use multiple font sizes in one label in Python, we can use fontsize in title() method.StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Plot x and y using plot() method.Initialize a variable, fontsize.Set the title of the plot ... Read More

How to put the Origin at the center of the cos curve in a figure in Python Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:34:30

1K+ Views

To put the Origin at the center of the cos curve in a figure, 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.Set the position of the axes using spines, top, left, right ... Read More

How do I specify an arrow-like linestyle in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:33:07

1K+ Views

To draw an arrow-like linestyle in matplotlib, we can use quiver() method.StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Use quiver() method to draw a line.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt ... Read More

Plot a vector field over the axes in Python Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:31:57

820 Views

To plot a vector field over the axes in matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Make X, Y, T, R, U and V data points using numpy.Add an axes to the current figure and make it the ... Read More

How to plot two Pandas time series on the same plot with legends and secondary Y-axis in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:30:43

2K+ Views

To plot two Pandas time series on the sameplot with legends and secondary Y-axis, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create a one-dimensional ndarray with axis labels (including time series).Make a dataframe with some column list.Plot columns A ... Read More

How does Python's Matplotlib.pyplot.quiver exactly work?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:29:09

237 Views

To work with quiver, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create vector cordinates using numpy array.Get x, y, u and v data points.Create a new figure or activate an existing figure using figure() method.Get the current axis using ... Read More

How to repress scientific notation in factorplot Y-axis in Seaborn / Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 04-Jun-2021 06:27:44

6K+ Views

To repress scientific notation in factorplot Y-axis in Seaborn/Matplotlib, we can use style="plain" in ticklabel_format()method.StepsSet the figure size and adjust the padding between and around the subplots.Make a dataframe with keys, col1 and col2.The factorplot() has been renamed to catplot().To repress the scientific notation, use style="plain" in ticklabel_format() method.To display ... Read More

Advertisements