Rishikesh Kumar Rishi has Published 1156 Articles

Plot 3D bars without axes in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

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

431 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

14K+ 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

1K+ 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

17K+ 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

Logscale plots with zero values in Matplotlib

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

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

2K+ Views

To logscale plots with zero values in matplotlib, we can use xscale() and yscale() methods with "symlog" class by name.StepsSet the figure size and adjust the padding between and around the subplots.Plot two lists containing zero values using plot() method.Use yscale() method with "symlog" class by name.Use xscale() method with ... Read More

How to create a legend for a 3D bar in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:44:44

1K+ Views

To create a legend for a 3D bar in matplotlib, we can plot 3D bars and place a legend using legend() method.StepsSet the figure size and adjust the padding between and around the subplots.Create a new figure or activate an esxisting figure using figure() method.Add an axes to the figure ... Read More

How to plot a dashed line on a Seaborn lineplot in Matplotlib?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:44:18

5K+ Views

To plot a dashed line on a Seaborn lineplot, we can use linestyle="dashed" in the argument of lineplot().StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Use lineplot() method with x and y data points in the argument and linestyle="dashed".To ... Read More

How to skip empty dates (weekends) in a financial Matplotlib Python graph?

Rishikesh Kumar Rishi

Rishikesh Kumar Rishi

Updated on 01-Jun-2021 11:44:01

1K+ Views

To skip weekends in a financial graph in matplotlib, we can iterate the time in dataframe and skip the plot if weekday is 5 or 6.StepsSet the figure size and adjust the padding between and around the subplots.Create a dataframe with keys time.Iterate zipped index and time of a date ... Read More

Advertisements