About 50 results
Open links in new tab
  1. How to view all colormaps available in matplotlib?

    Dec 16, 2015 · I was wondering if there is a function call that can give me the name of all colormaps available in matplotlib? It used to be possible by something along the lines of (see here): import …

  2. python - Matplotlib discrete colorbar - Stack Overflow

    I am trying to make a discrete colorbar for a scatterplot in matplotlib I have my x, y data and for each point an integer tag value which I want to be represented with a unique colour, e.g. plt.s...

  3. python matplotlib heatmap colorbar from transparent

    f,ax = plt.subplots() h = ax.imshow(np.random.rand(100,100),cmap='rainbow_alpha') plt.colorbar(mappable=h) Above code will create a colormap rainbow_alpha that is fully opaque at …

  4. how to extract a subset of a colormap as a new colormap in matplotlib?

    Sep 20, 2013 · Instead, use the 5 proper colormaps in matplotlib or the colormaps provided by cmocean or my CMasher. EDIT: In the latest version of CMasher, one can also use this same function to …

  5. Scatter plot and Color mapping in Python - Stack Overflow

    Importing matplotlib.cm is optional as you can call colormaps as cmap="cmap_name" just as well. There is a reference page of colormaps showing what each looks like.

  6. How can I get the matplotlib rgb color, given the colormap name ...

    17 How can I get the matplotlib rgb value for a number, NUM, given: A colormap ('autumn_r' which is yellow-to-red in the example below) BoundryNorm values ("2 to 10" in the example below) The …

  7. Create own colormap using matplotlib and plot color scale

    I have the following problem, I want to create my own colormap (red-mix-violet-mix-blue) that maps to values between -2 and +2 and want to use it to color points in my plot. The plot should then ha...

  8. Getting individual colors from a color map in matplotlib

    Aug 20, 2014 · If you have a Colormap cmap, for example: cmap = matplotlib.cm.get_cmap('Spectral') How can you get a particular colour out of it between 0 and 1, where 0 is the first colour in the map …

  9. How do parameters 'c' and 'cmap' behave? - Stack Overflow

    Aug 31, 2018 · plt.scatter(x,y, c=z, cmap=cmap) This is the reason that the output in the question will always be purple and yellow dots, independent of the values provided to c. Coming back to the …

  10. How to generate random colors in matplotlib? - Stack Overflow

    Feb 6, 2013 · What's the trivial example of how to generate random colors for passing to plotting functions? I'm calling scatter inside a loop and want each plot a different color. for X,Y in data: scatter(...