Ok, the problem is quite simple, I guess. What I'm trying to do is a bar plot where the data is plotted in sequence, ignoring if the current value is smaller than the previous one. For example, the following:
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
y = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
for index in range(len(x)):
plt.bar(x[index], y[index])
returns me this plot:
But if I add a new value to x and y (the new x value being smaller than the previous value), like:
import matplotlib.pyplot as plt
x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 2]
y = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 200]
for index in range(len(x)):
plt.bar(x[index], y[index])
the plot goes like this:
So, finally, how can I plot this new 2 value after 10 instead of going back right to the value previously plotted?


