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 <murpholi...@gmail.com> 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.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net

Reply via email to