Rishikesh Kumar Rishi has Published 1162 Articles

Python Scatter Plot with Multiple Y values for each X

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:52:49

7K+ Views

To make a scatter plot with multiple Y values for each X, we can create x and y data points using numpy, zip and iterate them together to create the scatter plot.StepsSet the figure size and adjust the padding between and around the subplots.Create random xs and ys data points ... Read More

What does axes.flat in Matplotlib do?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:47:53

3K+ Views

Axes.flat means a 1D iterator over the array. Let's take an example to see how to use axes.flat.StepsSet the figure size and adjust the padding between and around the subplots.Create a figure and a set of subplots using subplots() method.Create x and y data points using numpy.Use axes.flat and iterate ... Read More

How to write text above the bars on a bar plot (Python Matplotlib)?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:47:36

3K+ Views

To write text above the bars on a bar plot, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create lists of year, population and x. Initialize a width variable.Create a figure and a set of subplots using subplots() method.Set ylabels, title, ... Read More

Plot horizontal and vertical lines passing through a point that is an intersection point of two lines in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:47:19

1K+ Views

To plot horizontal and vertical lines passing through a point, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create two lines using slopes (m1, m2) and intercepts (c1 and c2). Initialize the slopes and intercepts values.Create x data points using numpy.Plot ... Read More

Plot 3D bars without axes in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:47:00

325 Views

To plot 3D bars without axes, we can take the following 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.Add an axes to the cureent figure as a subplot arrangement.Create x3, y3 and z3 data ... Read More

How to plot overlapping lines in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:46:40

12K+ Views

To plot overlapping lines in matplotlib, we can use variable overlapping that basically sets the opacity or alpha value in the plot.StepsSet the figure size and adjust the padding between and around the subplots.Initialize a variable overlapping to set the alpha value of the line.Plot line1 and line2 with red ... Read More

How to disable the minor ticks of a log-plot in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:46:16

3K+ Views

To disable the minor ticks of a log plot in matplotlib, we can use minorticks_off() 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, at index 1.Plot x and y data points with ... Read More

Plotting distance arrows in technical drawing in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:45:57

775 Views

To plot distance arrows in technical drawing in matplotlib, we can use annotate() method with arrow properties.StepsSet the figure size and adjust the padding between and around the subplots.Add a horizontal line across the axis using axhline() method, i.e., y=3.5.Add a horizontal line across the axis using axhline() method, i.e., ... Read More

Setting the same axis limits for all subplots in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:45:40

14K+ Views

To set the same axis limits for all subplots in matplotlib we can use subplot() method to create 4 subplots where nrows=2, ncols=2 having share of x and y axes.StepsSet the figure size and adjust the padding between and around the subplots.Add a subplot to the current figure at index ... Read More

Plot scatter points on a 3D projection with varying marker size in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:45:23

5K+ Views

To plot scatter points on a 3D projection with varying marker size, we can take the following stepsSet the figure size and adjust the padding between and around the subplots.Create xs, ys and zs data points using numpyInitialize a variable 's' for varying size of marker.Create a figure or activate ... Read More

Advertisements