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

learn more… | top users | synonyms (2)

42
votes
4answers
6k 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
1k 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 ...
2
votes
1answer
713 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, ...
34
votes
4answers
7k 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 ...
4
votes
2answers
502 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
1answer
5k 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 function....
8
votes
4answers
4k 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 ...
15
votes
3answers
2k views

Change the inner color of markers

I would like to have a marker with white as its inner color, to be able to make this kind of graph: If I use PlotMarkers -> Style["\[FilledSquare]", White], ...
30
votes
2answers
4k 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 <...
32
votes
2answers
10k 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 ...
27
votes
7answers
7k views

Changing the background color of the framed region of a plot

I frequently generate framed plots like this: Plot[Sin[x], {x, 0, 2 \[Pi]}, Frame -> True] Is there an easy way to change the background color of the framed ...
29
votes
2answers
1k views

How can I use Kenneth Moreland's “Diverging Color Maps for Scientific Visualization” in plots?

I often want to plot two dimensional data that is centered around zero (for me, this is usually a 2D optical spectroscopy signal, but there are other cases), and the MATLAB "Jet" color scheme is ...
41
votes
4answers
2k 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 ...
29
votes
1answer
437 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 ...
6
votes
2answers
340 views

Formatting text through pattern matching

I am trying to format some text based on some patterns. ...
21
votes
2answers
929 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
2answers
451 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 ...
10
votes
4answers
1k 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 ...
34
votes
2answers
4k 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 etc....
31
votes
3answers
973 views

A better “VisibleSpectrum” function?

Since ColorData["VisibleSpectrum"] is wrong, I would like to have a more accurate function to use. Can this information be extracted from Mathematica itself?
21
votes
4answers
3k views

Convert spectral distribution to RGB color

Presume that 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 ...
10
votes
6answers
1k views

can the color in MeshStyle be specified by a ColorFunction, such as “SunsetColors” for example. If so, what is the correct syntax?

This is an example given in Help: Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, MeshStyle -> Gray] Could this be changed to something like ...
16
votes
6answers
3k views

X-Y scatter plot with coloring dependent on Z value [duplicate]

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: ...
6
votes
1answer
217 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 ...
6
votes
2answers
792 views

Set the same color scale across multiple ListContourPlots?

This is probably straightforward - but how would I set the same color scale across multiple ListContourPlots? if I have values from 10 to 25 on one ListContourPlot and values from 40 to 100 on ...
6
votes
6answers
3k 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 ...
4
votes
2answers
440 views

Set the scale in ColorFunction [duplicate]

The following plot (A) ListLinePlot[{0,1,2,3},ColorFunction->"TemperatureMap"] goes from blue to read. The following plot (B) ...
50
votes
3answers
2k views

Changing color of an object in an image

Consider the following image: How can I change all red colors in this image into (for example) blue.
21
votes
1answer
1k 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 ...
25
votes
11answers
4k views

How to convert a hex color string to RGBColor?

For example: "#FF8000". How could I convert it to RGBColor or Hue?
24
votes
4answers
1k 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 ...
17
votes
2answers
5k 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
585 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
3answers
439 views

Match colors to plot themes

How do I get the colors to match the plot theme when I use a PlotLegend that is separate to the plots? I have had a look at How to access new colour schemes in ...
12
votes
2answers
2k 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 ...
9
votes
1answer
122 views

ArrayPlot with a user-defined color function is misbehaving

Bug introduced in 10.0 and persisting through 10.4.1 or later I am using ArrayPlot to show some arrays with values from 0 to 1. I want 0 to be black and 1 to be ...
9
votes
1answer
710 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 ...
3
votes
2answers
3k views

Define a color function using Piecewise

How can I define a ColorFunction for my ContourPlot using Piecewise? For example, after ...
2
votes
1answer
699 views

Invert Colors Stylesheet White on Black

There have been a couple studies done that showed that white text on a black background increase recall of data. Although this is certainly debatable how might I invert the colors of Notebook font ...
13
votes
1answer
392 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 ...
12
votes
2answers
430 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 ...
53
votes
3answers
3k views

Python-style plots in Mathematica

I love making plots in Mathematica. And I love to spend a lot of time making high-quality plots that maximize readability and aesthetics. For most cases, Mathematica can make very beautiful images, ...
20
votes
1answer
4k 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 ...
16
votes
6answers
2k 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, ...
41
votes
6answers
3k 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 ...
23
votes
5answers
1k views

Morphing Graphics, color and location

I would like to make a small animation : 1-We start with a random distribution of gray points : ...
15
votes
2answers
703 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 ...
15
votes
3answers
2k views

On coloring the faces of a surface differently with parameter-dependent colors

Old versions of Mathematica ($VersionNumber < 6) supported a particular syntax of ParametricPlot3D[] that allowed for ...
25
votes
5answers
762 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 Function[{z}, Hue[Arg[z]/(2 π), 1, Abs[z]]]. ...
19
votes
3answers
3k views

Filtering pixels of a certain color

What is the best way to filter an image so that only the pixels close to a certain color are left? I've downloaded some satellite images from the web where a specific pixel color corresponds to a ...