I need to plot several regions of the same column. The following code works fine to create the demanded plot:
graph = op.new_graph(template='scatter')
gl=graph[0]
for index, halfcycle in halfcycles.iterrows():
if index%10 == 0:
plot = gl.add_plot(f'[Book1]Sheet1!("current_interpolated","potential_interpolated")[{halfcycle["start"]}:{halfcycle["end"]}]', type='s')
gl.group(True,0,-1)
gl.rescale()
Unfortunately, this creates a legend with the same entry (column name) for each plot. I cannot find a way to create a legend like this:
- Potential (halfcycle 0)
* Potential (halfcycle 10)
# Potential (halfcycle 20)
x ...
Where the number represents the value of the index variable in the for-loop above.
Any help is very much appreciated.
Origin Ver. and Service Release: 2021b / 9.8.5.201
Operating System: Windows 10 / 1809ESR