The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Python
 Add several line plots as a grouped plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

TorbenS

Germany
12 Posts

Posted - 01/06/2021 :  3:58:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello again,

After having first success by automate the graph plotting I got to a new problem.
Lets say I want to plot 10 line graphs with the same x-Axis. I already have a template for this and used it in the "new_graph" statement.
My problem is, that I can only choose one coloum as Y-Axis. Thus, I tried to use a for loop and I was able to add all Y-Axis data to the plot.
But, the data is added one after another to the plot and the Y-Data is not grouped. Since the data is not grouped, I cannot apply Color Themes like "Rainbow7" to color the single plot.

So, is there an easy solution to add several Y-Data to the plot, or is the the easiest solution to color every single plot with a certain color.

Thanks in advance and best regards

Torben

Chris D

428 Posts

Posted - 01/07/2021 :  09:19:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You mention that you are using a template. I assume that the template was made using the plot type you want, it is grouped, and you defined your desired color list in the template.

If so, this script will do what you want (you'll need to adapt):

gr = op.new_graph(template = 'group_template.otpu')
lay = gr[0]
lay.add_plot(wks, 1, 0, type = 230) # type is template-defined, color is template-defined
lay.add_plot(wks, 2, 0, type = 230)
lay.add_plot(wks, 3, 0, type = 230)
lay.obj.LT_execute('layer -g')
lay.rescale()



Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

TorbenS

Germany
12 Posts

Posted - 01/08/2021 :  04:08:32 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

I was missing the LabTalk command 'layer -g'. Now the program operates as I wish.
Thanks a lot!

Best regards

Torben
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000