Skip to content Skip to sidebar Skip to footer

Plotting Phase Changes In Matplotlib/pandas

I'd like to be able to use matplotlib & pandas to create graphs based on dynamic data from a google spreadsheet. I've been successful in querying the spreadsheet with gspread,

Solution 1:

For anyone looking to do this in the future here's the thread I found to be helpful:vertical & horizontal lines in matplotlib

Here is a workable solution:

plt.axvline(x=2.5, ymin=0, ymax = 1.0, linewidth=1, color='k')

Still trying to figure out how to not have data paths connect across (other than interpolate nulls)

Solution 2:

Addressing your last comment in your answer, let's say that you have the following changes of phase

changes = [20,35,55]

you can plot the unconnected parts like this

first=0for c in changes:
    plt.plot(x[first:c], y[first:c])
    first= c+1
plt.plot(x[first:],y[first:])

Post a Comment for "Plotting Phase Changes In Matplotlib/pandas"