I´m trying to simplify my script using more indices for array; however, always get an IndexError. This is part of my script:
# Set the values in x-axis, only for the first plot
axs[0].set_xlim(0, 1200)
axs[0].set_ylim(-800, 200)
# Set the range of values in x-axis
axs[0].xaxis.set_major_locator(MultipleLocator(50))
# Set the values in y-axis, only for the rest
axs[1].set_xlim(0, 1200)
axs[1].set_ylim(0, 9)
axs[2].set_xlim(0, 1200)
axs[2].set_ylim(0, 9)
Well, I think that these lines could be more simplified. For example, using:
axs[1,2].set_ylim(0, 9)
Where the y-axis has the range 0-9; however, when I tried to made that I have the error:
IndexError: too many indices for array: array is 2-dimensional, but 3 were indexed
I understand the error partially; however, my question for this post is:
Is there a way to fix that problem to use in one line the ...[1,2]set_ylim...? Or there is no way to do that?