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
 Colormap not updating for palette

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
daanwielens Posted - 10/21/2022 : 06:08:45 AM
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:

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()
7   L A T E S T    R E P L I E S    (Newest First)
daanwielens Posted - 11/04/2022 : 10:11:58 AM
Hi minimax,

Thanks! I've just upgraded both the python package and Origin itself and it works.
minimax Posted - 11/03/2022 : 11:27:38 PM
Hi daanwielens,

The problem should have been fixed with originpro >= 1.1.3, but it also requires changes on Origin side.

i.e. you need to upgrade to Origin 2023 to get it work.
minimax Posted - 10/27/2022 : 10:50:20 PM
Yes, I will update you here when the bug is fixed.
daanwielens Posted - 10/27/2022 : 05:02:04 AM
Hi minimax,

Thanks for the reply. Will you report back here when the bug is fixed, or can I follow the issue on another platform? Thanks!
minimax Posted - 10/24/2022 : 05:29:37 AM
It seems that command plot.colormap failed to apply colors to a set of grouped plots from palette file.

We will try to fix it shortly. (internal bug track id: ORG-25825)

PS, to set as 'Binned' increment mode, you need to call
plot.colorinc=3


daanwielens Posted - 10/21/2022 : 11:02:34 AM
Hi James,

Thanks for your reply. What I try the replicate is outlined in the figure below: change the line color increment to 'Binned', then 'Load palette' and select 'Rainbow' (but then via Python). Is this possible?

Thanks!

YimingChen Posted - 10/21/2022 : 10:40:32 AM
You need to plot 3D surface or contour to set the colormap to color palette. See the example:
https://www.originlab.com/doc/en/python/Examples/Graphing#Plot_Contour_and_3D_Surface_Graph

James

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