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
 line type and line color

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
cts18488 Posted - 01/09/2024 : 09:48:47 AM
Hi,

I am trying to plot 2 workbooks in one graph, each workbook with its one colour and type. For example, first plot from first workbook to be red and solid line, the first plot from second workbook to be still red, but dash line; second plot from first workbook to be blue and solid line, the second plot from second workbook to be still blue, but dash line.

This is what I am trying
gl_ind_ORD = gr4[0]
p1_ind_ORD = gl_ind_ORD.add_plot(f'{wks_ORD.lt_range()}!(?,1:end)')
p1_ind_ORD_KK = gl_ind_ORD.add_plot(f'{wks_ORD_indCB_KK.lt_range()}!(?,1:end)')
p1_ind_ORD.set_int('line.width', 8)
p1_ind_ORD_KK.set_int('line.width', 8)
gl_ind_ORD.axis('y').title = f'\\b(CB-KK ({units}))'
gl_ind_ORD.group()
p1_ind_ORD.colormap = 'Candy'
p1_ind_ORD_KK.colormap = 'Candy'
gl_ind_ORD.rescale()
gl_ind_ORD.xlim = (min(csv_file['Wavelength']), max(csv_file['Wavelength']))

However, I wasn't able to get what I want.

For dash line, I have tried multiple codes, but none of them worked.
p1_ind_ORD.set_int('line.type', 2)
gl_ind_ORD.set_int('p1_ind_ORD.type', 2)
4   L A T E S T    R E P L I E S    (Newest First)
cts18488 Posted - 01/09/2024 : 6:48:12 PM
Hi,

I manage to solve that one. There were some strange settings on the template, which I fix it.

Now, I am trying to plot independently each plot using a for function. However, when I try to use set_int or set_cmd, there is an error "'list' object has no attribute 'set_int'". Do you know how can I can overcome this?

This is the code I am using:
gl_ind_ORD = [gr4 for i in range(3)] #gr4 has only 3 graphs
p1_ind_ORD_old = ['' for i in range(number_of_spectra)]
p1_ind_ORD_KK_old = ['' for i in range(number_of_spectra)]

p1_ind_ORD_old[0] = gl_ind_ORD[0].add_plot(wks_ORD, coly='B', colx='A')
p1_ind_ORD_old[0].set_int('line.width', 8)

Type of p1_ind_ORD_old[0] is <class 'originpro.graph.Plot'> so I don't understand the error is present.

Thank you,
Tibi

quote:
[i]Originally posted by ChaoC


Hello,

Could you check out this thread?
https://my.originlab.com/forum/topic.asp?TOPIC_ID=48121

Best,
Chao

ChaoC Posted - 01/09/2024 : 2:56:55 PM
Hello,

Could you check out this thread?
https://my.originlab.com/forum/topic.asp?TOPIC_ID=48121

Best,
Chao
cts18488 Posted - 01/09/2024 : 12:19:03 PM
Hi,

I have tried the set_cmd as well, but still does not work.

It seems that the plots are interlinked. The second plot takes all the parameters from the first. If the first plot is red and solid line the will have the same attributes. I have tried to take out .group() but this does not solve the issue.

Can you please help on this matter?

Thanks!
quote:
Originally posted by ChaoC

Hello,

Have you tried the set_cmd() function? It executes the LabTalk set command.

https://docs.originlab.com/originpro/classoriginpro_1_1graph_1_1Plot.html#a5a2b679b5067a02176bdbaa08f3b8487

https://www.originlab.com/doc/Labtalk/Ref/Set-cmd

Best,
Chao

ChaoC Posted - 01/09/2024 : 10:30:13 AM
Hello,

Have you tried the set_cmd() function? It executes the LabTalk set command.

https://docs.originlab.com/originpro/classoriginpro_1_1graph_1_1Plot.html#a5a2b679b5067a02176bdbaa08f3b8487

https://www.originlab.com/doc/Labtalk/Ref/Set-cmd

Best,
Chao

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