On Thursday, November 13, 2014 9:34:49 PM UTC-5, Chris Binz wrote:
>
> Is there a way of getting an individual color value via an "index" of a 
> ColorMap object in PyPlot? This (Python) code snippet (from here 
> <http://stackoverflow.com/a/12858391/2175008>) hopefully explains what 
> I'm after:
>
> >>> import matplotlib.pyplot as plt
>
> >>> Blues = plt.get_cmap('Blues')
> >>> print Blues(0)
> (0.9686274528503418, 0.9843137264251709, 1.0, 1.0)
>
>
using PyPlot, PyCall
Blues = get_cmap("Blues")
pycall(Blues.o, PyAny, 0)

In Julia 0.4 you will be able to do just Blues(0) rather than the explicit 
pycall(...), like in Python, thanks to the addition of call overloading, 
but I'm waiting until Julia 0.4 is closer to release.

Reply via email to