Since there are many such possible grids, we will see one more example with four different plots in a 2 x 2 grid, each one with a different type of graph, histogram, line, scatter, and bar graph. In the last example, we kept adding axes one by one, with the plt.subplot() method. In this example, we will define all axes in the grid at once, and then use indexing to access each of them and plot different graphs:
- Read Wine Quality and Iris datasets from .csv files and compute the mean and standard deviation for each of the attributes:
wine_quality = pd.read_csv('winequality.csv', delimiter=';')iris = pd.read_csv('iris_dataset.csv', delimiter=',')iris_mean = iris.mean()iris_std = iris.std()
- This defines the figure and its layout: ...