color-mapping Questions
3
Solved
I am trying to extract discrete colors from a matplotlib colormap by manipulating this example. However, I cannot find the N discrete colors that are extracted from the colormap.
In the code below...
Pesticide asked 8/11, 2015 at 16:57
2
I have 2-d fields to plot in python using matplotlib basemap.
The values of the fields varies from 0 to more than 1000. Is it possible to create manual colormap with fixed gradations and colours? ...
Canaster asked 26/8, 2014 at 12:54
4
Solved
In other words, I want to make a heatmap (or surface plot) where the color varies as a function of 2 variables. (Specifically, luminance = magnitude and hue = phase.) Is there any native way to do ...
Coquito asked 4/3, 2013 at 17:21
1
The documentation for set_array is very skimpy. What does it do? What range of values can it take? How does it work in conjunction with other color-related routines and data structures?
On the co...
Ignominy asked 28/4, 2018 at 15:22
3
Solved
I have a simple problem, but I cannot find a good solution to it.
I want to take a NumPy 2D array which represents a grayscale image, and convert it to an RGB PIL image while applying some of the ...
Jargon asked 9/6, 2012 at 23:48
1
I am making a 3 sided pyramid I have made the sides using add_collection3d(Poly3DCollection
But I want to add a colormap based on the z axis so that the top is red and it gradually change to blue ...
Bernadette asked 30/10, 2012 at 13:14
4
I have a time series of data for which I have the quantity, y, and its error, yerr. I would now like to create a plot that shows y against phase (i.e. time / period % 1) with vertical errorbars (ye...
Alyssaalyssum asked 18/4, 2012 at 11:53
2
Solved
Especially when working with grayscale images it is tedious to set the color map for every imshow command as imshow(i, cmap='gray'). How can I set the default color map matplotlib uses to grayscale...
Acetometer asked 17/10, 2015 at 9:35
4
Solved
I am using the MayaVi Python library to plot 3d points, using the points3d class. The documentation specifies that the colour of each point is specified through a fourth argument, s:
In addition...
Micrometer asked 30/8, 2013 at 16:1
1
Solved
I have a simple scatter plot where each point has a color given by a value between 0 and 1 set to a chosen colormap. Here's a MWE of my code:
import matplotlib.pyplot as plt
import numpy as np
im...
Harrumph asked 13/8, 2013 at 14:34
2
I am new to matplotlib, and have get stuck in colormaps.
In matplotlib how do I get the whole array of RGB colors for a specific colormap, let's say for "hot". For example if I was in MATLAB I wou...
Spalato asked 3/3, 2012 at 3:37
4
Solved
I am using matplotlib to create 2d line-plots. For the purposes of publication, I would like to have those plots in black and white (not grayscale), and I am struggling to find a non-intrusive solu...
Sleeper asked 9/9, 2011 at 6:52
1
Solved
I am experimenting with JPEG compression using python. I load in a tiff image and store it as numpy uint8 RGB array. I was doing this for color mapping.
def rgb2ycbcr(im):
cbcr = np.empty_like(im...
Miosis asked 20/1, 2016 at 23:59
1
Solved
I'm using Octave 3.8.1 which is like Matlab and I'm trying to create a color map / heatmap to look something like this
I have an array a1 where the 1st col is x, the 2nd col is y and the 3rd col...
Quattlebaum asked 9/11, 2015 at 13:39
3
Solved
I often want to plot a difference image that ranges from some negative number to some positive one. The issue with that is that matlab's colormaps scale only from the min value to the max value but...
Disini asked 27/5, 2013 at 22:19
3
Solved
I am fairly new to Matlab and have a few questions.
I got two surfaces and a plane in the same figure.
I want to use different colormap and colorbar for b and another colormap and colorbar for c. s...
Nedanedda asked 9/11, 2011 at 23:19
1
Solved
I have a square array of elements which correspond to lattice sites. Some of the elements are zero and the rest vary between 1 and about 2700. Using imshow and the OrRd colour map, I want all latti...
Round asked 21/3, 2014 at 2:0
3
Solved
I am plotting a histogram using
plt.imshow(hist2d, norm = LogNorm(), cmap = gray)
where hist2d is a matrix of histogram values. This works fine except for elements in hist2d that are zero. In pa...
Beaverette asked 26/2, 2012 at 16:55
1
Solved
Let's suppose the example below
import matplotlib.pyplot as plt
import numpy as np
v1 = -1 + 2*np.random.rand(50,150)
fig = plt.figure()
ax = fig.add_subplot(111)
p = ax.imshow(v1,interpolation='...
Grandiloquent asked 2/3, 2014 at 13:28
1
Solved
I'm trying to replicate the style of the attached figure using matplotlib's facilities.
Basically, I want to change the colour of the curve according to its y-value using matplotlib.
Boogie asked 23/11, 2013 at 16:58
2
I want to set a colour scheme for my python plots, so that they don't repeat the same colour like they are for A and H in the top plot shown below. (sorry if its difficult to see).
The code...
Dm asked 16/11, 2013 at 16:58
4
Solved
I'm using matplotlib 1.3.0 and I have the following:
import matplotlib.pyplot as plt
cmap = plt.cm.jet
plt.contourf([[.12, .2], [.8, 2]], levels=[0, .1, .3, .5, 1, 3], cmap=cmap, vmin=0, vmax=3)
p...
Cachepot asked 3/9, 2013 at 19:3
2
Solved
I've placed a color bar alongside a choropleth map. Because the data being plotted are discrete rather than continuous values, I've used a LinearSegmentedColormap (using the recipe from the scipy c...
Hamite asked 9/9, 2013 at 18:11
1
Solved
I'm plotting a confusion matrix as the following with colorbar in it:
What I would like to do now is keep everything exactly the same, but inverse the colors. I have tried the following code (wh...
Odessa asked 25/7, 2013 at 7:54
2
Solved
I'd like to create a colormap in matlab.
I want to fade the color according to gray level of pixel.
For example:
from 255 to 160 -> white
from 159 to 120 -> pink
from 119 to 50 -> brown...
Ftc asked 21/6, 2013 at 8:33
1 Next >
© 2022 - 2025 — McMap. All rights reserved.