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

learn more… | top users | synonyms (2)

33
votes
4answers
3k 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 ...
26
votes
7answers
1k 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 ...
26
votes
1answer
330 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 ...
26
votes
1answer
971 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 ...
25
votes
4answers
3k 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 ...
21
votes
3answers
444 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 ...
20
votes
9answers
1k views

How to convert a hex color string to RGBColor?

For example: "#FF8000". How could I convert it to RGBColor or Hue?
20
votes
5answers
454 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 ...
19
votes
4answers
855 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 ...
19
votes
4answers
568 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 ...
18
votes
2answers
532 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: ...
17
votes
2answers
301 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
1answer
358 views

Color scheme used by Colorize?

The Colorize function is often used to display the results produced by MorphologicalComponents: ...
16
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
2answers
556 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
4answers
701 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 ...
14
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, ...
14
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: ...
12
votes
3answers
462 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 ...
12
votes
3answers
338 views

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

If I plot an array with option ColorFunction -> "Rainbow" : ...
12
votes
2answers
315 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
244 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
989 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
506 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
907 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 ...
11
votes
5answers
451 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
511 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
290 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$ ...
11
votes
1answer
343 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 ...
11
votes
2answers
245 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
749 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
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
2k 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
2answers
350 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 ...
10
votes
2answers
686 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 ...
9
votes
2answers
2k views

problem with coloring spherical harmonics

I want to color a spherical harmonics. So I write as follows. ...
9
votes
4answers
901 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 ...
9
votes
2answers
736 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
311 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
1answer
203 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
116 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 ...
8
votes
4answers
2k views

Coloring Points in a List Plot [duplicate]

Possible Duplicate: ListPlot with each point a different color and a legend bar I want to color the points in a list plot using a function of the (x,y) values. I tried this (example with ...
8
votes
3answers
952 views

Which ColorFunction should I use to get such a gradient of blue-cyan-green-yellow-orange-red?

I want to get the effect in the above Figure. Here is my code: ...
8
votes
3answers
217 views

Quickly display a color graphically

When manipulating colors, the output is shown as a textual expression like Hue[1/5], RGBColor[2/3, 1, 1/3], ...
8
votes
3answers
676 views

256 Shades of Grey

I noticed that the following line, Image[Table[x, {y, 1, 250}, {x, 30/256, 40/256, 0.02/256}], Magnification -> 1] results in the following image: In the ...
8
votes
2answers
781 views

ColorFunction in Histogram[]

Let's say I have a Histogram: Histogram[RandomVariate[NormalDistribution[10, 2], 500]] and I want the bars positioned to ...
8
votes
1answer
436 views

Discrete coloring in Plots

I would like to have a plot that is filled to the axis with Green if the y value is greater than 10, and ...
8
votes
2answers
412 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 ...
8
votes
1answer
792 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 ...