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
 Set theme of Plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

jy1u18@soton.ac.uk

United Kingdom
6 Posts

Posted - 07/04/2022 :  11:52:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I'm trying to use the originpro module to plot and change the theme of a series of graphs. But Plot.shapelist does not seem to be working. I do have a theme saved as "AppCurve-CV", but it does not apply that to the Plot. Any help?

Many thanks,
Christopher


import originpro as op
import numpy as np
import pandas as pd

wkslist=np.arange(1,2).tolist()
nameDic={1:'50Hz',2:'60Hz',3:'80Hz',4:'100Hz',5:'150Hz',6:'200Hz',7:'500Hz',8:'None'}

for wksnum in wkslist:
    pg=op.new_graph(f'20220704-ECLCVCheck-{nameDic[wksnum]}')
    lyr=pg[0]
    wks=op.find_sheet('w',f'Book{wksnum}')
    plt=lyr.add_plot(wks,1,0,type='y')
    plt.shapelist='AppCurve-CV' #HERE!!!
    lyr.rescale()

minimax

351 Posts

Posted - 07/04/2022 :  11:15:47 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It seems like a bug and we will look into it (track ID: ORG-25456)
Go to Top of Page

minimax

351 Posts

Posted - 07/05/2022 :  02:56:58 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Christopher,

What shapes are used in your theme file?
Go to Top of Page

jy1u18@soton.ac.uk

United Kingdom
6 Posts

Posted - 07/05/2022 :  06:25:30 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

Hi Christopher,

What shapes are used in your theme file?


Hi,

it's line and scatter
Go to Top of Page

minimax

351 Posts

Posted - 07/05/2022 :  11:03:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Christopher,

I may not make myself clear.

shapelist command works on a set of scatter shapes.

And I wonder what is the scatter shapes inside your theme file.

A typical shape theme looks like following

Go to Top of Page

jy1u18@soton.ac.uk

United Kingdom
6 Posts

Posted - 07/06/2022 :  07:17:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by minimax

Hi Christopher,

I may not make myself clear.

shapelist command works on a set of scatter shapes.

And I wonder what is the scatter shapes inside your theme file.

A typical shape theme looks like following





I thought it allows me to apply the whole theme to the graph no?
Or it just applys the shapelist of the theme?
In that case, that makes sense, cuz I think there's no shapelist, there is only one shape.

Is there a function that allows me to apply the whole theme? color, label, font, scale, ticks and everything?

Kind regards,
Christopher
Go to Top of Page

minimax

351 Posts

Posted - 07/06/2022 :  10:36:58 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
"shapelist" command is specific to scatter plot's symbol shape only and not applicable to your case.

And currently there is no native python interface to apply a whole theme (including plot, axis etc.).

You may try Labtalk script for now, like

pg=op.new_graph(f'20220704-ECLCVCheck-{nameDic[wksnum]}')
lyr=pg[0]
wks=op.find_sheet('w',f'Book{wksnum}')
plt=lyr.add_plot(wks,1,0,type='y')

#themeApply2g is an XF which applies theme onto graph window
pg.lt_exec(f'themeApply2g theme:="AppCurve-CV";')
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