- 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
Found 784 Articles for Data Visualization
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
92 Views
To make xtick labels of a plot be simple drawings using Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Initialize the y position of simple drawings.Create a new figure or activate an existing figure using figure() method.Add an '~.axes.Axes' to the figure as part of a subplot arrangement using add_subplot()method.Plot a line using plot() method.Set the X-axis ticks using set_ticks() method.Set empty tick labels.Add circles and rectangles patches using add_patch() method. Instantiate Circle() and Rectangle() class.To display the figure, use show() method.Exampleimport matplotlib.pyplot as plt import matplotlib.patches as patches ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
413 Views
To indicate the statistically significant difference in bar graph, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Create means, std, index, width and labels data points.Create a figure and a set of subplots using subplots() method.Make a bar plot using bar() method.Plot Y versus X as lines and/or markers with attached errorbars.Scale the Y-axis.Get or set the current tick locations and labels of the X-axis.To display the figure, use show() method.Exampleimport numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True means = (5, 15, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
1K+ Views
To show node name in graphs using networkx, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Initialize a graph with edges, name, or graph attributes.Add multiple nodes using add_nodes_from() method.Add all the edges using add_edge_from() method.Draw the graph G with Matplotlib using draw() method. Set with_labels to True.To display the graph, we can use show() method.Exampleimport matplotlib.pylab as plt import networkx as nx plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True G = nx.DiGraph() G.add_nodes_from([1, 2, 3, 4]) G.add_edges_from([(1, 2), (2, 1), (2, 3), (1, 4), (3, 4)]) nx.draw(G, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
838 Views
To add a title on Seaborn Implot, we can take the following steps−Set the figure size and adjust the padding between and around the subplots.Make a Pandas dataframe with two columns, X-Axis and Y-AxisUse implot() method.Get the current axis using gca() method.To display the figure, use show() method.Exampleimport pandas import matplotlib.pylab as plt import seaborn as sns import numpy as np plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True df = pandas.DataFrame({"X-Axis": [np.random.randint(10) for i in range(10)], "Y-Axis": [i for i in range(10)]}) bar_plot = sns.lmplot(x='X-Axis', y='Y-Axis', data=df, height=3.5) ax = plt.gca() ax.set_title("Random Data Implot") ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
634 Views
To plot a transparent Poly3DCollection plot in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplotsCreate a new figure or activate an existing figure.Add an '~.axes.Axes' to the figure as part of a subplot arrangement with projection=3d.Create x, y and z data points.Make a list of vertices.Convert x, y and z data points into a zipped list of tuples.Get a list of instance of Poly3d.Add a 3D collection object to the plot using add_collection3d() method.Turn off the axes.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
888 Views
To plot two horizontal bar charts sharing the same Y-axis, we can use sharey=ax1 in subplot() method and for horizontal bar, we can use barh() method.StepsCreate lists for data points.Create a new figure or activate an existing figure using figure() methodAdd a subplot to the current figure using subplot() method, at index=1.Plot horizontal bar on axis 1 using barh() method.Add a subplot to the current figure using subplot() method, at index=2. Share the Yaxis of axis 1.Plot the horizontal bar on axis 2.To display the figure, use show() method.Exampleimport matplotlib.pyplot as plt import numpy as np plt.rcParams["figure.figsize"] = [7.50, ... Read More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
7K+ Views
To remove a specific line or curve in Matplotlib, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Plot line1 and line2 using plot() method.Pop the second line and remove it.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt, image as mimg plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True line_1 = plt.plot([1, 2, 3]) line_2 = plt.plot([2, 4, 6]) line = line_2.pop(0) line.remove() plt.show()Output
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
2K+ Views
To set a colormap of an image, we can take the following steps −Set the figure size and adjust the padding between and around the subplots.Read an image from a file into an array.Pick one channel of your data.Display the data as an image, i.e., on a 2D regular raster with "hot" colormapTurn off the axes.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt, image as mimg plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True img = mimg.imread('bird.jpg') lum_img = img[:, :, 0] plt.imshow(lum_img, cmap="hot") plt.axis('off') plt.show()OutputRead More
![Rishikesh Kumar Rishi](https://www.tutorialspoint.com/assets/profiles/318007/profile/60_254496-1615815423.jpg)
4K+ Views
To plot at full resolution with matplotlib.pyplot, imshow() and savefig(), we can keep the dpi value from 600 to 1200.StepsSet the figure size and adjust the padding between and around the subplots.Set random values in a given shape.Display the data as an image, i.e., on a 2D regular rasterSave the figure with 1200 dpi.To display the figure, use show() method.Examplefrom matplotlib import pyplot as plt import numpy as np plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True data = np.random.rand(5, 5) plt.imshow(data, cmap="plasma") plt.savefig("myimage.eps", dpi=1200) plt.show()Output