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
 How to plot an " Image Plot" from a matrix

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 - 12/10/2024 : 5:12:53 PM
Origin Ver. 2024b and Service Release (Select Help-->About Origin):
Operating System: Windows11

Hi,

Can you please tell me what is the code to plot an "Image Plot" from a matrix? Can you please add the code how to change the colour pallete and how to set the levels for the colour scale. Thank you!
2   L A T E S T    R E P L I E S    (Newest First)
minimax Posted - 12/11/2024 : 09:35:56 AM
Hi cts18488,

Besides the lt_exec() method ChaoC mentioned, you may also try following

import originpro as op
ms=op.find_sheet('m', '[MBook1]')
gl = op.new_graph(template='image')[0]
gl.add_mplot(ms, z=0, type=220) #220 is image plot type id
#https://www.originlab.com/doc/zh/LabTalk/ref/Plot-Type-IDs
gl.rescale()

pl = gl.plot_list()[0]
zl = pl.zlevels
zl['minors'] = 4
zl['levels'] = [0, 8, 16, 24, 32]
pl.zlevels = zl
pl.colormap = 'Beach.pal'

ChaoC Posted - 12/10/2024 : 8:03:14 PM
Hello,

1. You can activate your matrix and run: op.lt_exec('run.section(Plot3D.ogs,ImagePlot)')

2. Documentation for setting colormap:
https://docs.originlab.com/originpro/classoriginpro_1_1graph_1_1Plot.html#a5d33966d43e1be87689f6488d418a542

3. You can use lt_exec with these LabTalk options:
https://www.originlab.com/doc/LabTalk/ref/Layer-CMap-obj

E.g op.lt_exec('layer.cmap.nummajorLevels=8')
op.lt_exec('layer.cmap.setLevels(1)')

Best,
Chao

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