I would like to create a plot where the independent variable is on the vertical axis, or expressed differently, where the x-axis is vertical. The reason is that the x-axis represents depth.
Say I have the depths stored in x, and the dependent variable stored in y
I know that I can achieve this for a single line using the matplotlib function plt.plot(y,x) instead of plt.plot(x,y)
However, this creates secondary issues with parameters that are usually defined on the dependent variables. For example, I don't know how I could then plot error ranges, as shown in the code below.
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 10, 11)
y = np.linspace(2, 3, 11)
ymax = y+1;
ymin = y-1;
plt.figure()
plt.plot(x,y)
plt.fill_between(x,ymin,ymax, facecolor='blue', alpha=0.5)
Note that I am not looking for a workaround to plot error ranges on the independent variable, because that will not solve other similar issues.