Is there a one-liner or a short, elegant solution to flip the data and the labels of a figure? Something like fig.swapaxes(swap=true). This function should make the first plot look like the second one.
import numpy as np
import matplotlib.pyplot as plt
height = np.linspace(40,100,100)
weight = 3.0*height
######################## First Plot #####################
fig = plt.figure()
ax = fig.gca()
ax.plot(height,weight)
ax.set_xlabel('height')
ax.set_ylabel('weight')
## Is there a one-liner or a short, elegant solution to flip
## the data and the labels? something like fig.swapaxes(swap=true)
## this function should make the first plot look like the second one
##
################ Second Plot ###########################
fig = plt.figure()
ax = fig.gca()
ax.plot(weight,height)
ax.set_xlabel('weight')
ax.set_ylabel('height')