I use the following code to plot a graph:
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(t_list,list1,linestyle='-')
ax.plot(t_list,list2,linestyle='--')
plt.show()
The values that appear on the y-axis are values from list1 and list2.
I am trying to make my y-axis start from a variable v so that the y-axis reads "v + " the values in list1 and list2. So basically instead of starting from zero, I want the y-axis to start from "v", then "v + " values in list.
Is that possible since I'm plotting two different lists on the same graph?
What I tried:
I tried chaning the y_ticks before calling the plot function:
fig = plt.figure()
ax = fig.add_subplot(111)
y_ticks1 = ["v + " + str(y) for y in list1]
y_ticks2 = ["v + " + str(y) for y in list2]
ax.plot(t_list,y_ticks1,linestyle='-')
ax.plot(t_list,y_ticks2,linestyle='--')
plt.show()
This results in a valueError: could not convert string to float.