1/18/2024 0 Comments Matplotlib subplot share y![]() ![]() plot ( 'x_values', 'z_values', data = df, marker = 'o', color = "orange", alpha = 0.3 ) # Show the graph plt. The sharedyaxes argument to makesubplots can be used to link the y axes of subplots in the resulting figure. ![]() ![]() plot ( 'x_values', 'z_values', data = df, marker = 'o', color = "grey", alpha = 0.3 ) # The last one is spread on 1 column only, on the 4th column of the second line. You can share the x- or y-axis limits for one axis with another by passing an Axes instance as a sharex or sharey keyword argument. plot ( 'x_values', 'y_values', data = df, marker = 'o', alpha = 0.4 ) # The second one is on column2, spread on 3 columns ax2 = plt. subplot2grid ( ( 2, 4 ), ( 0, 0 ), colspan = 4 ) ax1. 1 Answer Sorted by: 0 A quick (and possibly very stupid) fix I found is to sort of do the axis sharing manually. The parameter nrows is used to indicate the number of rows and the parameter ncols is used to indicate the number of columns of the subplot grid. DataFrame ( ) # 4 columns and 2 rows # The first plot is on line 1, and is spread all along the 4 columns ax1 = plt. # libraries and data from matplotlib import pyplot as pltÄf = pd. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |