Posts

Showing posts with the label subplot

How to add a subplot

Image
How to add a subplot How can you add a graph as a subplot . subplot I can plot a stand alone graph . But I would like to add this as a subplot . plot graph subplot import pandas as pd import matplotlib.pyplot as plt d = ({ 'A' : ['1','1','1','2','2','2','3','3','3','3'], 'B' : ['A','B','C','A','B','C','D','A','B','C'], 'C' : ['John','Carl','Carl','John','Lily','John','Lily','John','Carl','Carl'], 'D' : [1,2,3,4,5,6,7,8,9,10], 'E' : [0,2,4,6,5,6,7,8,9,10], }) df = pd.DataFrame(data=d) fig = plt.figure(figsize = (9,4)) def One_plot(ax,pid, fontsize=12): ax.set_title('One Plot', fontsize=10) ax.scatter(df['E'],df['D']) ax.grid(False) def Tw...