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
 All Forums
 Origin Forum for Programming
 Forum for Python
 Add several line plots as a grouped plot

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
TorbenS Posted - 01/06/2021 : 3:58:37 PM
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
2   L A T E S T    R E P L I E S    (Newest First)
TorbenS Posted - 01/08/2021 : 04:08:32 AM
Hello,

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

Best regards

Torben
Chris D Posted - 01/07/2021 : 09:19:24 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000