- 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
3K+ Views
First, we can initialize an array matrix and pass it into the imshow method that can help to get the image for the given matrix.StepsCreate a 2D Array i.e., img.Using imshow() method, display the data as an image, i.e., on a 2D regular raster.Use plt.show() method to show the figure.Exampleimport ... Read More
Rishikesh Kumar Rishi
2K+ Views
To make a custom color, we can create a hexadecimal string. From it, we can make different sets of color representation and can pass into the scatter method to get the desired output.StepsTake an input from the user for the number of colors, i.e., number_of_colors = 20.Use Hexadecimal alphabets to ... Read More
Rishikesh Kumar Rishi
3K+ Views
To make a custom color, we can create a hexadecimal string. From it, we can make different sets of color representation and can pass them into the scatter method to get the desired output.Using the set_color method, we could set the color of the bar.StepsTake user input for the number ... Read More
Rishikesh Kumar Rishi
1K+ Views
We can override the backend value using atplotlib.rcParams['backend'] variable.StepsUsing get_backend() method, return the name of the current backend, i.e., default name.Now override the backend name.Using get_backend() method, return the name of the current backend, i.e., updated name.Exampleimport matplotlib print("Before, Backend used by matplotlib is: ", matplotlib.get_backend()) matplotlib.rcParams['backend'] = 'TkAgg' print("After, ... Read More
Rishikesh Kumar Rishi
367 Views
Using the subplot method, we can configure the number of rows and columns. nrows*nclos will create number positions to draw a diagram.StepsNumber of rows = 2, Number of columns = 1, so total locations are: 2*1 = 2.Add a subplot to the current figure, nrow = 2, ncols = 1, ... Read More
Rishikesh Kumar Rishi
422 Views
We can first activate the figure using plt.ion() method. Then, we can update the plot with different sets of values.StepsCreate fig and ax variables using subplots method, where default nrows and ncols are 1.Draw a line, using plot() method.Set the color of line, i.e., orange.Activate the interaction, using plt.ion() method.To ... Read More
Rishikesh Kumar Rishi
234 Views
Using Pandas, we can create a data frame and create a figure and axis. After that, we can use the scatter method to draw points.StepsCreate lists of students, marks obtained by them, and color codings for each score.Make a data frame using Panda’s DataFrame, with step 1 data.Create fig and ... Read More
Rishikesh Kumar Rishi
6K+ Views
ROC − Receiver operating characteristics (ROC) curve.Using metrics.plot_roc_curve(clf, X_test, y_test) method, we can draw the ROC curve.StepsGenerate a random n-class classification problem. This initially creates clusters of points normally distributed (std=1) about vertices of an ``n_informative``-dimensional hypercube with sides of length ``2*class_sep`` and assigns an equal number of clusters to ... Read More
Rishikesh Kumar Rishi
264 Views
Using plt.subplots(1, 1) method, we can create fig and axis. We can use fig.colorbar to make the color bar at the midpoint of the figure.StepsUsing mgrid() method, `nd_grid` instance which returns an open multi-dimensional "meshgrid".Create Z1, Z2 and Z data.Create fig and ax variables using subplots method, where default nrows ... Read More
Rishikesh Kumar Rishi
479 Views
We can use matplotlib.rcParams['backend'] to override the backend value.StepsUsing get_backend() method, return the name of the current backend, i.e., default name.Now override the backend name.Using get_backend() method, return the name of the current backend, i.e., updated name.Exampleimport matplotlib print("Before, Backend used by matplotlib is: ", matplotlib.get_backend()) matplotlib.rcParams['backend'] = 'TkAgg' print("After, ... Read More
To Continue Learning Please Login
Login with Google