Set Nan Color in carta-python #155
-
|
Dear Carta community, I am currently exploring the great capabilities of carta-python. How do I set the background color when scripting a plot? When using carta interactively, it is possible to change the nan-color. However, I do not fin this option in the documentation nor the source code. Thanks for you help in advance. Cheers, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi! There currently isn't a high-level interface for manipulating preferences from the wrapper, but you can use the low-level interface. The NaN colour and transparency are stored in two different preferences, which you can change like this: session.call_action("preferenceStore.setPreference", "nanColorHex", "#00ff00")
session.call_action("preferenceStore.setPreference", "nanAlpha", "0.5")Despite the name, You can reset to the default NaN colour settings like this: session.call_action("preferenceStore.clearPreferences", ["nanColorHex", "nanAlpha"]) |
Beta Was this translation helpful? Give feedback.
Hi! There currently isn't a high-level interface for manipulating preferences from the wrapper, but you can use the low-level interface. The NaN colour and transparency are stored in two different preferences, which you can change like this:
Despite the name,
nanColorHexcan be any valid HTML colour (so e.g.redwill work). However, if you use a format with an alpha value, like RGBA, the colour will change, but the alpha value will be ignored (it's always overridden by thenanAlphavalue).You can reset to the default NaN colour settings li…