colormap

I need to create a linear color map with a color for "errors"

I need to create a linear color map with a color for "errors" Question: I need to create a color map that behaves linearly between 0 and 1 on a grey scale. Then I also want that any number outside the range [0,1] is drown red. Would it be possible? Asked By: Aslan986 || Source …

Total answers: 1

How to create a Matplotlib colormap that loops until a certain value?

How to create a Matplotlib colormap that loops until a certain value? Question: So, I want to have a colormap that is the ‘bone’ colormap for the values from a to b, then continues as the reverse colormap of ‘bone’ from b to 2b-a (in such a way that it completes a cycle). Then I …

Total answers: 2

Image artefacts when using cyclic colormaps for periodic data

Image artefacts when using cyclic colormaps for periodic data Question: I am currently trying to visualize the phase of an electromagnetic field which is 2pi-periodic. To visualize that e.g. 1.9 pi is almost the same as 0, I am using a cyclic colormap (twilight). However, when I plot my images, there are always lines at …

Total answers: 1

Colormap in the background of a scatterplot in Python

Colormap in the background of a scatterplot in Python Question: I’d like to plot a colormap behind my scatterplot showing that as far as you go from the median value, the worst your parameter is. Something like the following image (but smoother and with a defined colormap): Here’s a MWE of what I used to …

Total answers: 1

pandas.DataFrame.plot showing colormap inconsistently

pandas.DataFrame.plot showing colormap inconsistently Question: So am trying to make some plots and was trying to use the cmap "jet". It kept appearing as viridis, so I dug around SE and tried some very simple plots: import numpy as np import matplotlib.pyplot as plt x = np.arange(0, 100) y = x t = x df …

Total answers: 2

Unclear difference in displaying the same image by opencv and matplotlib

Unclear difference in displaying the same image by opencv and matplotlib Question: During my work on image processing I encounter a strange phenomenon that is not clear to me. I have an image with dimensions of: (256, 256, 1) And when I display it with opencv using the following code: cv2.imshow(‘image’, image) cv2.waitKey() I get …

Total answers: 1

How to extract rgb values of this colorbar image in python?

How to extract rgb values of this colorbar image in python? Question: Image I want to make a colormap used in the attached image colorbar. So far I tried the code given below but didn’t get the result I was looking for. import matplotlib.pyplot as plt from matplotlib.colors import LinearSegmentedColormap import numpy as np img …

Total answers: 1

Trying to add a colorbar to a Seaborn scatterplot

Trying to add a colorbar to a Seaborn scatterplot Question: I’m a geology master’s student working on my dissertation with a focus on the Sulfur Dioxide output of a number of volcanoes in the South Pacific. I have a little experience with R but my supervisor recommended python (JupyterLab specifically) for generating figures and data …

Total answers: 1

How to get N easily distinguishable colors with Matplotlib

How to get N easily distinguishable colors with Matplotlib Question: I need to make different amounts of line plots with Matplotlib, but I have not been able to find a colormap that makes it easy to distinguish between the line plots. I have used the brg colormap like this: colors=brg(np.linspace(0,1,num_plots)) with for i in range(num_plots): …

Total answers: 1