- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Rishikesh Kumar Rishi has Published 1162 Articles
Rishikesh Kumar Rishi
5K+ Views
To get a list of axes of a figure, we will first create a figure and then, use get_axes() method to get the axes and set the labels of those axes.Create xs and ys using numpy and fig using figure() method. Create a new figure, or activate an existing figure.Use ... Read More
Rishikesh Kumar Rishi
4K+ Views
To get rid of grid lines when plotting with Pandas with secondary_y, we can take the following steps −Create a data frame using DataFrame wth keys column1 and column2.Use data frame data to plot the data frame. To get rid of gridlines, use grid=False.To display the figure, use show() method.Exampleimport pandas as ... Read More
Rishikesh Kumar Rishi
2K+ Views
To save a file with legend outside the plot, we can take the following steps −Create x data points using numpy.Plot y=sin(x) curve using plot() method, with color=red, marker="v" and label y=sin(x).Plot y=cos(x), curve using plot() method, with color=green, marker="x" and label y=cos(x).To place the legend outside the plot, use bbox_to_anchor(.45, 1.15) ... Read More
Rishikesh Kumar Rishi
2K+ Views
To change scale of a table, we can use the scale() method. Steps −Create a figure and a set of subplots, nrows=1 and ncols=1.Create a random data using numpy.Make columns value.Make the axis tight and off.Initialize a variable fontsize to change the fontsize.To set the fontsize of the table and to ... Read More
Rishikesh Kumar Rishi
4K+ Views
To plot black-and-white binary map in matplotlib, we can create and add two subplots to the current figure using subplot() method, where nrows=1 and ncols=2. To display the data as a binary map, we can use greys colormap in imshow() method.StepsCreate data using numpyAdd two sublots, nrows=1 and ncols=2. Consider ... Read More
Rishikesh Kumar Rishi
2K+ Views
To create a legend for a contour plot in matplotlib, we can take the following steps−Create x, y and z data points to plot the contour function.To create a 3D filled contour plot, we can use contourf() method with x, y, z and different levels.Make a list of rectangle with ... Read More
Rishikesh Kumar Rishi
5K+ Views
To change the text color of font in the legend in matplotlib, we can take the following steps−Create x and y data points using numpy.Plot x and y using plot() method, where color of line is red and label is "y=exp(x)".To place the legend, use legend() method with location of ... Read More
Rishikesh Kumar Rishi
3K+ Views
To reduce the chances of overlapping between x and y tick labels in matplotlib, we can take the following steps −Create x and y data points using numpy.Add a subplot to the current figure at index 1 (nrows=1 and ncols=2).Set x and y margins to 0.Plot x and y data points and add a title to this subplot, ... Read More
Rishikesh Kumar Rishi
651 Views
To plot scatter points with increasing size of marker, we can take the following steps−StepsCreate x and y data pointsTo get increasing size of marker, make a list of numbers.Use scatter method to plot scatter points.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt plt.rcParams["figure.figsize"] = [7.00, ... Read More
Rishikesh Kumar Rishi
181 Views
To style a part of label in legend, we can take the following steps −Create data point for x using numpy.Plot a sine curve using np.sin(x) with a text label.Plot a cosine curve using np.cos(x) with a text label.To place the legend on the plot, use legend() method.To display the figure, ... Read More