Author |
Topic |
|
cts18488
United Kingdom
82 Posts |
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) |
|
ChaoC
USA
174 Posts |
|
cts18488
United Kingdom
82 Posts |
|
ChaoC
USA
174 Posts |
|
cts18488
United Kingdom
82 Posts |
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
|
|
|
|
Topic |
|
|
|