I have a a subplot that I define using add_subplot() with gridspec. I am looking to rotate this plot and its contents by 90 degrees, but I don't have the information on the content a-priori. This is because the axis is defined as part of a general Canvas class that I've built. I also do not want to just flip the x and y contents in the function call ax.plot(y,x) as this will introduce complications later in my code.
Is there a way to reliably rotate the axes when I create them, so that when I call ax.plot(x,y), the x-data is on the vertical axis, and the y-data on the horizontal axis?