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
 Assigning different Color and Symbol for Datapoint
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Salman4750

Germany
10 Posts

Posted - 06/22/2020 :  08:05:02 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

This is the code i am using to plot a Scatter Plot.

name = Oapp.CreatePage(Oapp.OPT_GRAPH,"Scatter Plot","Graph")
gp = Oapp.GraphPages(name)
gpl = gp.Layers(0)
for i in range(totalColumnsno-1):
gpl.AddPlot(rng[i] , 201)


I have plotted five variables using OriginExt without using pre-defined Templates. But now I am wondering how can I assign different Colors using OriginExt to each Variable during plotting a scatter plot of different variables using RGB scheme and how I can assign different symbols to them. I have tried to assess the colormap but it's not working for me. I would be very thankful if someone can help me with this.


Thank you


salman

Edited by - Salman4750 on 06/22/2020 08:07:01 AM

Chris D

428 Posts

Posted - 06/23/2020 :  09:23:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Various classes in OriginExt implement an Execute method that can execute a LabTalk statement (in string form) in the context of the object (e.g. a GraphLayer).

So you could create LabTalk `set` commands to customize your plots. E.g.:

gpl.Execute('layer.plot=2') # Activate 2nd plot.
gpl.Execute('set %c -c color(255,0,0)') # Set color to red



Here are docs for the set command.
https://www.originlab.com/doc/Labtalk/Ref/Set-cmd


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

Salman4750

Germany
10 Posts

Posted - 06/23/2020 :  7:09:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Chris Drozdowski,

Thanks for your reply. it's really helpful for me.

Thanks,


salman
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