- 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](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
959 Views
To change the color of data points based on some variable in matplotlib, we can take the following steps −Create x, y and c variables using numpy.Plot the scatter points using x, y and for color, use c (Step 1).To display the image, use the show() method.Exampleimport numpy as np from ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
6K+ Views
To put a legend outside the plot with Pandas, we can take the following Steps −Make a dictionary d with keys Column1 and Column2.Make a data frame using DataFrame (d).Plot the data frame with a list of styles.Using legend(), place a legend on the figure. The bbox_to_anchor keyword gives a great ... Read More
How to make pylab.savefig() save image for 'maximized' window instead of default size in Matplotlib?
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
1K+ Views
To save image for maximized window instead of default size, we can use the following Steps −Create figure with figsize=(7.50, 3.50), using the figure() method.Plot the lines using the plot() method with list, color=”red”, and linewidth=2.Save the figure using the savefig() method.To display the figure, use the show() method.Examplefrom matplotlib import ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
15K+ Views
To show multiple figures in matplotlib, we can take the following Steps −To create a new figure, or activate an existing figure, use the figure() method. (Create two figures namely, Figure1 and Figure2).Plot the lines with the same lists (colors red and green and linewidth 2 and 5).Set the title ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
591 Views
To position a textbox automatically in matplotlib, we can take the following Steps −Create xpoints from 1 to 2 and 100 samples.Create y1points and y2points using xpoints (Step 1) and numpy.Plot xpoints, y1points and y2points using the plot() method.To set the label, use the legend() method. It will help to position the text box.To display the figure, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
369 Views
Definingadd_axes − Add an axes to the figure.add_subplot − Add an axes to the figure as part of a subplot arrangement.StepsCreate a new figure, or activate an existing figure, using the figure() method.Add an axes to the figure as part of a subplot arrangement where nrows=2, ncols=2. At index 1, add ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
311 Views
To change the color of a line using radiobuttons, we can take the following steps −Create x, sin and cos data points using numpy.Adjust the figure size and padding between and around the subplots.Create a figure and a set of subplots using the subplots() method.Plot curve with x and y ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
119 Views
To detect outliers in one dimensional observation data, we can take the following Steps −Create spread, center, flier_high and flier_low.Using the above data (Step 1), we can calculate data.Use the suplots() method to create a figure and a set of subplots, i.e., fig1 and ax1.Set the title of ax1.Now using ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
183 Views
ExampleAbs(x, y) => √(x)2+(y)2Scale(f) => (x*f, y*f)ApproachDefine a vertex as a struct.Initialize the vertex with some x and value.Define a method to calculate absolute(x, y).Define a method to calculate scale(x*f, y*f).Example Live Demopackage main import ( "fmt" "math" ) type Vertex struct { X, Y float64 } func ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
Rishikesh Kumar Rishi
164 Views
ExampleApproachAsk the user to enter the size of array.Make a string array of given size.Ask the user to enter elements.At the end, print the array.Example Live Demopackage main import "fmt" func main(){ arr := []int{10, 20, 30, 60, 40, 50} boolArr := []bool{true, false, true, false, true, false} ... Read More