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
Colormap not updating for palette
Note:
Only the poster of this message, and the Moderator can edit the message.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Forum:
Forum for Python
Subject:
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
Origin Ver: 2022 SR1 Operating System: Win 10 ------------------------------------------------------- Hi, I'm trying to create a plot with grouped data and then apply a color palette (rainbow) to it (with increment binned/stretched). I fail at the first step, i.e. selecting the colormap. When I select a increment list ('Candy', 'Fire', 'Classic') the colors of the plot (plot.colormap) do change, but if I select any color palette ('Rainbow.pal', 'Maple.pal') the color of the plot doesn't change. According to the documentation of originpro.graph.Plot.colormap this should be working. Code used: [code] import originpro as op # Start a new origin project op.new() # Choose whether Origin should be visible or not (default = True) op.set_show(True) # Create grouped data set x = np.linspace(0, 10, 501) y1 = np.sin(x) y2 = np.sin(x+0.1) y3 = np.sin(x+0.2) y4 = np.sin(x+0.3) y5 = np.sin(x+0.4) # Create a new worksheet in writing mode wks = op.new_sheet('w') # Add data to the worksheet wks.from_list(0, x) wks.from_list(1, y1) wks.from_list(2, y2) wks.from_list(3, y3) wks.from_list(4, y4) wks.from_list(5, y5) # Create a figure gp = op.new_graph() # Create a graph object gl = gp[0] # Select the first layer # Plot entire worksheet plot = gl.add_plot(f'{wks.lt_range()}!(?,1:end)') # Group the plots gl.group() plot.colormap = 'Rainbow.pal' gl.rescale() [/code]
Check here to subscribe to this topic.
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000