SourceForge logo
SourceForge logo
Menu

pymol-users

From: Murpholino P. <mur...@gm...> - 2018年02月06日 14:37:40
Is there a way to add a color bar to a volume?
I am looking for something like the bar in the last picture here (
https://pymolwiki.org/index.php/Ramp_New)
This is my volume https://www.dropbox.com/s/x4ic7uvdlknk8us/volume.png?dl=0
Thanks.
From: Thomas H. <tho...@sc...> - 2018年02月07日 08:37:48
Hi Murpholino,
You could convert your volume colors to a ramp object with a Python script like this:
# conversion function
def volume2ramp(volname, rampname='', mapname='none'):
 v = cmd.volume_color(volname)
 colors = []
 for i in range(0, len(v), 5):
 colors.append('0x%02x%02x%02x' % (
 int(v[i + 1] * 0xff),
 int(v[i + 2] * 0xff),
 int(v[i + 3] * 0xff)))
 cmd.ramp_new(rampname or cmd.get_unused_name('ramp'),
 mapname, v[0::5], colors)
# apply to your volume object
volume2ramp('myvolume')
Hope that helps.
Cheers,
 Thomas
> On Feb 6, 2018, at 3:36 PM, Murpholino Peligro <mur...@gm...> wrote:
> 
> Is there a way to add a color bar to a volume?
> I am looking for something like the bar in the last picture here (https://pymolwiki.org/index.php/Ramp_New)
> This is my volume https://www.dropbox.com/s/x4ic7uvdlknk8us/volume.png?dl=0
> 
> 
> Thanks. 
--
Thomas Holder
PyMOL Principal Developer
Schrödinger, Inc.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /