- 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
6K+ Views
To combine two heatmaps in seaborn, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Create two Pandas data frames.Create a figure and a set of subplots, ax1 and ax2.Plot the rectangular data as a color-encoded matrix, on ax1 and ax2.Move ticks and ticklabels (if present) to the right of the axes.Keep the width of the padding between subplots minimum, as a fraction of the average axes width.To display the figure, use show() method.Exampleimport matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns plt.rcParams["figure.figsize"] ... Read More
361 Views
To create a boxplot stratified by column in Python class, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Create a Pandas data frame of two-dimensional, size-mutable, potentially heterogeneous tabular data.Compute the histogram of a set of data.Create a boxplot startified by column.To display the figure, use show() method.Exampleimport pandas as pd import numpy as np from matplotlib import pyplot as plt # Set the figure size plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True # Pandas dataframe df = pd.DataFrame({"column1": [4, 6, 7, 1, 8], "column2": [1, 5, 7, ... Read More
1K+ Views
To plot aggregated by date pandas dataframe, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Create a data frame, df, of two-dimensional, size-mutable, potentially heterogeneous tabular data.Get the values of aggregated by date pandas dataframe.Plot the df (Step 3) with kind="bar".To display the figure, use show() method.Exampleimport numpy as np import pandas as pd from matplotlib import pyplot as plt, dates # Set the figure size plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True # Create a dataframe df = pd.DataFrame(dict(data=list(pd.date_range("2021-01-01", periods=10)), value=np.linspace(1, 10, 10))) df = df.groupby('data').agg(['sum']).reset_index() ... Read More
2K+ Views
To have the line color vary with the data index for a line graph in matplotlib, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Get smaller limit, dydx.Get the points and segments data points using numpy.Create a figure and a set of subplots.Create a class which, when called, linearly normalizes data into some range.Set the image array from numpy array *A*.Set the linewidth(s) for the collection.Set the colorbar for axis 1.Generate Colormap object from a list of colors i.e r, g and b.Repeat ... Read More
638 Views
To format a float using matplotlib's LaTeX formatter, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Create x and y data points using numpy.Plot the x and y data points using plot() method.Fill the area between the curve.Set the title of the figure with LaTeX representation.To display the figure, use show() method.Exampleimport numpy as np from matplotlib import pyplot as plt # Set the figures size plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True # x and y data points x = np.linspace(-5, 5, 100) y = x**3/3 ... Read More
2K+ Views
To set local rcParams or rcParams for one figure in matplotlib, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Initialize a variable N to store the number of sample data.Create x and y data points using numpy.Return a context manager for temporarily changing rcParams.Add a subplot to the current figure, at index 1.Plot the x and y data points, using plot() method.Add a subplot to the current figure, at index 2.Plot the x and y data points, using plot() method.To display the figure, use show() method.Exampleimport pandas as pd import ... Read More
31K+ Views
To plot multiple boxplots in one graph in Pandas or Matplotlib, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Make a Pandas data frame with two columns.Plot the data frame using plot() method, with kind='boxplot'.To display the figure, use show() method.Exampleimport pandas as pd import numpy as np from matplotlib import pyplot as plt # Set the figure size plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True # Pandas dataframe data = pd.DataFrame({"Box1": np.random.rand(10), "Box2": np.random.rand(10)}) # Plot the dataframe ax = data[['Box1', 'Box2']].plot(kind='box', title='boxplot') # Display ... Read More
6K+ Views
To plot a multivariate function in Python, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Create random x, y and z data points using numpy.Create a figure and a set of subplots.Create a scatter plot with x, y and z data points.Create a colorbar for a ScalarMappable instance, s.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 def func(x, y): return 3 * x + 4 * y - 2 + np.random.randn(30) x, y ... Read More
2K+ Views
To make a polygon radar (spider) chart in Python, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Create a Pandas dataframe with sports and values columns.Create a new figure or activate an existing figure.Add an 'ax' to the figure as part of a subplot arrangement.Based on data frame values, get the theta value.Get the values list of the data frame.Make a bar plot with theta and values data points.Fill the area between polygon.To display the figure, use show() method.Exampleimport pandas as pd import matplotlib.pyplot as plt import numpy as np ... Read More
5K+ Views
To add a legend in a 3D scatterplot with scatter() in matplotlib, we can take the following steps −StepsSet the figure size and adjust the padding between and around the subplots.Initialize a variable N to store the number of sample data.Create x and y data points; make z1 and z2 data points list.Add a subplot to the current figure, with projection='3d'.Plot the x, y and z1 data points using plot() points on 2d axes, with marker *.Plot the x, y and z2 data points using plot() points on 2d axes, with marker o.Place legend on the figure.To display the figure ... Read More
To Continue Learning Please Login
Login with Google