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

learn more… | top users | synonyms (2)

26
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 ...
6
votes
1answer
2k views

Fixed color scale in multiple density plots

I think there should be a simple solution for my current problem, but neither StackOverflow (or the help of Mathematica) or Google have it. I have to plot multiple density plots with a color ...
36
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 ...
4
votes
2answers
340 views

Coloring a shape according to a function

I would like to create a $2D$ shape, say an ellipse, where each point in the ellipse is colored according a RGB function, so at point ...
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 ...
26
votes
1answer
342 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 ...
18
votes
2answers
540 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: ...
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: ...
2
votes
1answer
266 views

White regions in DensityPlot — is this a bug with ColorFunctionScaling?

Is this a bug with ColorFunctionScaling? When I try to supply my own ColorFunction Mathematica seems to partially ignore it, ...
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 ...
11
votes
2answers
389 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 ...
4
votes
2answers
218 views

Formatting text through pattern matching

I am trying to format some text based on some patterns. ...
10
votes
4answers
790 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 ...
26
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 ...
15
votes
2answers
482 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 ...
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, ...
17
votes
2answers
335 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 ...
16
votes
2answers
589 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: ...
11
votes
6answers
517 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 ...
6
votes
1answer
179 views

Is it possible to render Graphics with more than “Byte” bitdepth?

I wonder is it possible to render Graphics in Mathematica with bitdepth higher than "Byte" which is the maximum bitdepth ...
8
votes
1answer
456 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 ...
6
votes
2answers
382 views

Monochrome PNG (and GIF) Export

Is there a way to Export expressions to a monochrome PNG? I have tried the ColorQuantize function which is mentioned in ...
4
votes
1answer
230 views

Apply color function to matrix plot

I want to apply the following color rules to a large table of numbers. I have extracted a part of the table to use as an example. I would like to assign 5 different colors to 5 different ranges of ...
1
vote
2answers
218 views

How to blend some colors on a curve

I need to define a color gradient on a 3D curve, but I'm having some problems with this. Suppose we have a 3D curve defined as a parametric function of some real variable ...
9
votes
2answers
2k views

problem with coloring spherical harmonics

I want to color a spherical harmonics. So I write as follows. ...
4
votes
1answer
244 views

How can I colorize an imported model?

How can I colorize an imported model from for example 3ds max? I'm trying to find the way to colorize a 3D plot from an imported model with something like this: ...
3
votes
2answers
251 views

Color of a plane in Contourplot3D

I have the following code example: ...
3
votes
2answers
719 views

Use ColorFunction in ListLinePlot with If

The following code ListLinePlot[{2, 4, 6, 8, 10, 12}, ColorFunction -> Function[{x, y}, If[x <= 3, Blue, Red]]] should produce blue lines for $x\le3$ and ...
19
votes
4answers
870 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 ...
26
votes
6answers
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 ...
17
votes
1answer
372 views

Color scheme used by Colorize?

The Colorize function is often used to display the results produced by MorphologicalComponents: ...
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?
15
votes
4answers
713 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 ...
11
votes
4answers
3k views

How to change default notebook background color?

How does one change the default notebook background color?
10
votes
2answers
586 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 ...
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 ...
8
votes
0answers
184 views

Break[] inside ColorFunction

f[x_?NumericQ]:= (Do[Break[],{i,1,2}];x) Plot[x,{x,0,1},ColorFunction->(ColorData["Rainbow"][f[#]]&)] Break::nofwd: No enclosing For, While, or Do found ...
5
votes
2answers
727 views

Plot3D with coloring based on phase value of f

I'm reading a sample chapter of Visual Complex Functions by E. Wegert. Near the bottom of this page, there is a link "Download Sample pages 1 (pdf, 2.4 MB)" which allows you to read Chapter 2 of the ...
2
votes
1answer
176 views

How can I create a colour image using raw black and white data? (FITS data cube)

I have a data cube containing pictures of a galaxy across a thousand wavelengths. I want to take the data for the image slides in the red and blue parts of the spectrum, and have them represented in ...
8
votes
2answers
807 views

ColorFunction in Histogram[]

Let's say I have a Histogram: Histogram[RandomVariate[NormalDistribution[10, 2], 500]] and I want the bars positioned to ...
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 ...
8
votes
1answer
353 views

Way to find color at a point in a Graphics?

I need to figure out a way to find out the RGB color value at a certain coordinate in a Graphics object. The Graphics object I am dealing with is continually Dynamically updated, so it is made of ...
6
votes
4answers
1k views

Determining the RGB values of the default plot color

In Mathematica 7, the default plot color is a purple-like color (although I think it is not Purple). Is it possible to use Mathematica to determine the RGB color ...
4
votes
2answers
227 views

Modified Cell Different Display

Is there a way to show maybe a slightly different color, or change the cell bracketing color of a Mathematica cell when it has been modified? Ideally it would be nice to follow the standard of ...
4
votes
2answers
625 views

Define a color function based on color samples obtained from ColorBrewer

I am quite new to mathematica and I am searching for a way to create a smooth colormap based on the samples given by http://colorbrewer2.org/ . Is it possible to create a interpolated function from ...
9
votes
2answers
765 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 ...
6
votes
6answers
1k views

How do I fill in a circle made by ParametricPlot with one solid color?

I have a very simple question but I am new with Mathematica. I made a circle on a parametric plot and I made the line black. I want to make the inside of the circle on the parametric plot red. So the ...
6
votes
3answers
528 views

Changing background colour of a Manipulate element

Please consider the following: Manipulate[Plot[Sin[x (1 + a x)], {x, 0, 6}], {a, 0, 2}]; Now, I would like to change the background colour to yellow. I tried ...
5
votes
1answer
999 views

ListContourPlot-ColorFunction

How can I use ONLY the central 90% of the spectrum, not the whole range? For example, I do not like to see the lowest values in purple, but in deep blue color. ...
3
votes
2answers
370 views

What is the default ColorFunction for 3D plots?

This should be a really simple question, but it isn't in the documentation for some perverse reason. I like the default ColorFunction that Mathematica uses for ...