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
 python box plot with selected columns

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

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

* Forum Code is ON
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
syxz0628 Posted - 03/29/2023 : 04:53:26 AM
Origin Ver. and Service Release (Select Help-->About Origin): OriPro2022
Operating System:windows10
I want to use python to generate a box plot.
The selection of column and rows is not clear to me.I have tried using column number, it works, although, I can only add_plot one by one.
plot = glayer.add_plot(f'{wks.lt_range()}!(,10)[:]')
plot = glayer.add_plot(f'{wks.lt_range()}!(,11)[:]')
however, I want to select specific columns with string 'RWS' in the longname.
How could I achieve it.
2   L A T E S T    R E P L I E S    (Newest First)
posseportray Posted - 11/27/2023 : 04:58:32 AM
Your solution worked perfectly for me. Thank you!
YimingChen Posted - 03/29/2023 : 09:04:54 AM
You can loop through the columns, and check and add 'RWS' columns. See the sample code:

import originpro as op
wks = op.find_sheet();
glayer = op.new_graph(template='box.otpu')[0]
for i in range(wks.cols):
    if wks.get_label(i) == 'RWS':
        plot = glayer.add_plot(wks, i)


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