Author |
Topic |
|
maniubi
China
4 Posts |
Posted - 04/18/2023 : 07:30:09 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): Operating System:
p1 = gl_1.add_plot(wks) I want to make all the data in the sheet (5 groups of data, xy) on the graph, how to operate,
plot = gl.add_plot(f'{wks.lt_range()}!(?,1:end)') And,I don't know what that means(f'{wks.lt_range()}!(?,1:end)') and,it doesn't work
f'{wks.lt_range()}!(?,1:end)'------Report an error How to write the correct range
|
Edited by - maniubi on 04/18/2023 10:08:51 AM |
|
YimingChen
1618 Posts |
Posted - 04/18/2023 : 11:08:57 AM
|
Could you please provide the entire script? The script you provided below worked for me to add multiple xy data to the graph simultaneously.
plot = gl.add_plot(f'{wks.lt_range()}!(?,1:end)')
James |
|
|
maniubi
China
4 Posts |
Posted - 04/18/2023 : 11:04:31 PM
|
Thank you for your answer. This is an official example that I copied, but it doesn't work (during drawing),
wks = op.new_sheet() wks.from_file(os.path.join(op.path('e'), 'Samples', 'Graphing', 'Group.dat')) graph = op.new_graph(template='scatter') gl=graph[0]
# plot whole sheet as XY plot plot = gl.add_plot(f'{wks.lt_range()}!(?,1:end)')
# group the plots and control plots setting in group gl.group() plot.colormap = 'Candy' plot.shapelist = [3, 2, 1] gl.rescale()
# Exit running instance of Origin. # Required for external Python but don't use with embedded Python. if op.oext: op.exit()
How to determine the scope using this method,(f'{wks.lt_range()}!(?,1:end)')
Afterwards, I tried and found that if I replaced (?, 1: end) with (?, 2) or (?, 4), it would work normally, but only one xy data would work. I want more sets of data (8 xy), or more, so how do I represent it
|
Edited by - maniubi on 04/18/2023 11:31:36 PM |
|
|
YimingChen
1618 Posts |
Posted - 04/19/2023 : 08:54:45 AM
|
Have you used Origin 2023 to test the script? Here the input will resolve to [Book1]Group!(?,1:end), where '?' indicates that the range is forced to use worksheet designation, and '1:end' indicates all y columns are plotted.
James |
|
|
maniubi
China
4 Posts |
Posted - 04/19/2023 : 09:53:50 AM
|
The script I used for origin2021 testing,Can it only use origin2023 |
Edited by - maniubi on 04/19/2023 09:55:47 AM |
|
|
YimingChen
1618 Posts |
Posted - 04/19/2023 : 2:21:47 PM
|
Yes. Please upgrade to Origin 2023 for testing.
|
|
|
maniubi
China
4 Posts |
Posted - 04/19/2023 : 10:06:50 PM
|
Thank you for your help. I will try testing on origin2023 |
|
|
|
Topic |
|
|
|