Questions on the color models, schemes, named colors and color functions supported by Mathematica.

learn more… | top users | synonyms (2)

36
votes
4answers
4k views

How to change the default ColorData used in Mathematica's Plot?

This question leads on from the recent question What are the standard colors for plots in Mathematica? There it was determined that the default color palette used by ...
31
votes
6answers
2k views

ColorData[“VisibleSpectrum”] is wrong?

I am trying to visualize the visible spectrum using the built-in ColorData["VisibleSpectrum"] function which "colors based on light wavelength in nanometers". But I ...
28
votes
4answers
4k views

Density plot on the surface of sphere

I would like to make density plots of a list of (size 2 or 3) spherical harmonics on the surface of a sphere. I'd like to plot it so that each element of that list is using a different color (red ...
28
votes
1answer
1k views

The correct way to linearize colorspace before resizing, blurring etc

There was an interesting discussion on MathGroups dealing with the fact that image-processing functions in Mathematica (and many other software, including Adobe Photoshop) work with RGB, Grayscale ...
27
votes
1answer
365 views

Is there a way to access the (lexically) current colour inside Graphics?

Note that this is not a duplicate of the question over there. That one asks for a given point, while I'm asking about the lexical structure (which, of course, is not directly related to any point in ...
24
votes
3answers
615 views

Is there an easy way to use Matteo Niccoli's perceptual color maps for 2D plots in Mathematica?

I have been using the ubiquitous Jet color palette for 2D plots for some time now, and don't really care for it. Then I came across the series of blog posts, The rainbow is dead...long live the ...
23
votes
3answers
471 views

How does one adjust ColorFunction quality independently of surface quality?

I have a function $f:\mathbb{C}\rightarrow\mathbb{C}$ which I would like to visualize by by plotting $|f|$ with Plot3D using $\operatorname{Arg}f$ as the ...
22
votes
4answers
937 views

Create colour with given lightness value

How can I create a colour of my chosen hue with a given fixed lightness level? For example, how can I create a reddish colour, col, so that ...
21
votes
9answers
2k views

How to convert a hex color string to RGBColor?

For example: "#FF8000". How could I convert it to RGBColor or Hue?
21
votes
5answers
534 views

Compiling ColorFunction for faster complex phase-amplitude plots

I have gotten into the habit of plotting complex-valued functions on a plane using a color-function along the lines of ...
20
votes
4answers
627 views

How can I get the color of overlapping disks to be equal in any order?

When Graphics is used, necessarily the objects come in order. This affects which ones obscure others. When Opacity is not 1, it also affects the color. I would like the color of overlaps to depend ...
19
votes
2answers
895 views

How to access new colour schemes in version 10?

Many colour schemes and colour functions can be accessed using ColorData. Version 10 introduced new default colour schemes, and a new customization option using ...
18
votes
2answers
589 views

Blend code for built-in ColorData schemes

Hi I want to get a blend similar to "SunsetColors". To make those slight modifications, I would like to know the precise blend of that color scheme. My try: ...
18
votes
1answer
411 views

Color scheme used by Colorize?

The Colorize function is often used to display the results produced by MorphologicalComponents: ...
17
votes
2answers
368 views

Pattern that matches colors

Suppose I'm writing a function that takes a color as a parameter; for example: drawShape[color_] := Graphics[{Style[Disk[], color]}]; But if the caller inputs an ...
17
votes
2answers
3k views

How to save plots in grayscale

As sophomoric as this question seems, how should I save plots in grayscale in Mathematica? I generally like eps images for their scalability and I use ghostscript or other third party perl scripts ...
16
votes
6answers
2k views

X-Y scatter plot with coloring dependent on Z value

I have an array of $(x,y,z)$ triples (array dimensions: N x 3), from which I can make a 2D scatterplot of $(x,y)$ values: ...
16
votes
2answers
634 views

Exporting a dashed plot with a color gradient to a vector graphics format ruins the dashing

When exporting a dashed plot with a color gradient to a vector graphics format such as EPS or PDF, the dashing is partly ruined. For example, this command: ...
15
votes
6answers
1k views

How to find major color in a picture?

I want to find the major color (the color which appears most often) in a picture and do some analysis later. For example, if I have this picture: What I want to do is find out that gray, red, ...
15
votes
4answers
731 views

How can I create a ColorFunction using Blend?

As shown below, I am trying to find a cool way to show some variance weighted deviation from the mean. There are 10 attributes that I compute the distance for. How can I add a color function such ...
15
votes
2answers
1k views

What are the standard colors for plots in Mathematica 10? [duplicate]

Mathematica 10 release appears to have changed the default styling of plots: the most visible changes are thicker lines and different default colors. Thus, answers to this stackoverflow question are ...
14
votes
4answers
1k views

How to change element color in Periodic Table?

The command ColorData["Atoms", "Panel"] generates a periodic table. As I don't want to reinvent the wheel, I asked myself how to change the color of each cell ...
14
votes
2answers
375 views

Convert spectral distribution to RGB color

Presume I have a spectrum as a function of wavelength (an example being the blackbody spectrum): I want to convert that to a single RGB color to display on-screen, i.e. the "color" of that object ...
13
votes
3answers
651 views

How can I convert colors to grayscale?

I want to change the above colored plot into a grayscale plot. I have tried this: CCGray[pic_?ImageQ] := Module[{}, ColorConvert[pic, "GrayScale"]]; but it ...
13
votes
3answers
390 views

Impose the color for one discrete value above a color predefined gradient

If I plot an array with option ColorFunction -> "Rainbow" : ...
13
votes
1answer
1k views

Is it possible to style multiple Plot or ListPlot curves using a color gradient?

I am using Mathematica 8. In Mathematica, there is a default PlotStyle coloring in Plot and ...
12
votes
2answers
347 views

Using uniform coloring in MatrixPlot

I have a rectangular matrix, which is m-by-10. Each element is either 0 or 1. I would like 0 to correspond to white elements, and 1 to red elements. This works ...
12
votes
2answers
322 views

Color Histogram3D by Bin Location

I am using a Histogram3D plot to view the correlation of the R & G of an RGB image. Naturally, I want the bins to have a color corresponding to their $x$, $y$ ...
12
votes
2answers
255 views

Why does DominantColors keep shuffling the order of the results?

This graphic is produced by running DominantColors (new in Mathematica 9) with different values, using the Lena image as the source: Each row is a list of the ...
12
votes
2answers
1k views

Using a ListDensityPlot to map color onto a ListPlot3D graph

I have a 3 column list of data points. The first two columns correspond to x and y coordinates, with data points creating a surface in the z direction from column 3. This gives me a nice wavy ...
12
votes
1answer
567 views

PieChart with radial coloring/color function

I am trying to visually compare multiple functions that depend on a single argument running from $0$ to $1$. They describe a radial property and so I thought it would be nice to use a kind of ...
12
votes
1answer
208 views

Is it possible to insert new colour schemes into ColorData?

Because of the standards in my field, for many plots I need to use (or at least end up using) rather narrowly defined colour schemes, and in particular the Matlab "Jet" scheme, which is well described ...
11
votes
5answers
589 views

Default Chart Color Doesn't Match

I have looked through other posts to find out what the default plot color is, but when I use it, the color doesn't seem to match. Can anyone explain why I'm seeing different output? The reason I ask ...
11
votes
4answers
3k views

How to change default notebook background color?

How does one change the default notebook background color?
11
votes
6answers
540 views

Overlapping Red and Green ArrayPlots to show yellow intersections

Let's say I have two ArrayPlot[]s. One is in redscale and the other is in greenscale, such that the lowest value is white and the highest value is pure red or ...
11
votes
2answers
422 views

How can I prevent ColorFunction from disabling antialiasing in graphics?

When I use ColorFunction, the appearance of my plots is ruined, changing from this which has the normal smooth lines and antialiased fonts, to this in which ...
11
votes
2answers
797 views

How to vary color of fill between listplots based on y-distance between them

I have two lists with the same x-values but different y-values. I have used ListPlot to plot and fill the space (line) between them; however, I would like the color ...
11
votes
2answers
255 views

can a ColorFunction have side effects?

Can anyone explain this (to me) odd behavior. If I run this code once (fresh kernel) it works as intended. ...
10
votes
4answers
886 views

Coloring Points in a Plot, based on their position in the list

Before I describe the question, I'd like to say that I've seen the excellent answers posted here but have not managed to get them to work for my own data. I have a list of values that I would like to ...
10
votes
4answers
1k views

Height-dependent filling color in 3D Data Plots

I would like to have the filling of my ListPlot3D display the same color than the one applied to the data. This question makes sense only in the case of conditional coloring of data (according to ...
10
votes
2answers
250 views

Modify existing color scheme

I am using the "TemperatureMap" color scheme for image processing. How can I set the lowest color value to Black? Generally ...
10
votes
4answers
2k views

How to convert rgb to YCbCr?

I looked at ColorConvert, but haven't found a relevant option. Is there a built-in function do this?
10
votes
2answers
3k views

Use different ColorFunction for each function plotted

When plotting two curves on one plot, you can specify different colors for each function: Plot[{Sin@x, Cos@x}, {x, 0, 4π}, PlotStyle -> {Red, Blue}] To ...
10
votes
1answer
353 views

How to find a specific color in one picture?

In a picture, there are many different colors. How can I just want to find the position of one color. In the following picture, if I would like to find the coordinates of the position of blue, how can ...
9
votes
2answers
2k views

problem with coloring spherical harmonics

I want to color a spherical harmonics. So I write as follows. ...
9
votes
2answers
868 views

Coloring each face of a Cuboid with a different color

Is there a way to color each face of a Cuboid with a different color? I looked in the help but couldn't find anything. I found this Coloring the faces of a 3D ...
9
votes
1answer
1k views

Logarithmic scale in a DensityPlot and its legend

I was recently faced with the task of creating a DensityPlot with a logarithmic colour scale, and with providing it with an appropriate legend. Since I could not find any resources to this effect on ...
9
votes
1answer
215 views

Error Using Sow in DensityHistogram with ColorFunction

To find the color values used in a plot, I was using Sow as shown here: ...
9
votes
1answer
152 views

What is the default ColorFunction for Image3D?

What is the default ColorFunction for Image3D? I find it a bit confusing that the most intense colour is not shown where the ...
9
votes
1answer
97 views

Mathematica's “POV” export format ignores ColorFunction

I was playing with xslittlegrass's Pov-Ray package and more generally with the POV-conversion function ExportString[#, "POV"] &, and noticed that ...