Skip to main content

Questions tagged [color]

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

Filter by
Sorted by
Tagged with
96 votes
2 answers
59k 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 ...
Ruslan's user avatar
  • 7,172
72 votes
3 answers
7k 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, ...
Dargor's user avatar
  • 1,369
62 votes
4 answers
6k 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 ...
Jason B.'s user avatar
  • 69k
56 votes
4 answers
4k 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.
John's user avatar
  • 4,371
54 votes
5 answers
17k 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 ...
QuantumDot's user avatar
  • 19.7k
54 votes
2 answers
11k 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 <...
Szabolcs's user avatar
  • 236k
51 votes
6 answers
6k views

ColorData["VisibleSpectrum"] is wrong?

Bug introduced in 10.0 or earlier and fixed in 11.1 I am trying to visualize the visible spectrum using the built-in ColorData["VisibleSpectrum"] function which "...
Alexey Popkov's user avatar
46 votes
4 answers
10k 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 ...
Simon's user avatar
  • 10.2k
43 votes
2 answers
10k views

The correct way to linearize colorspace before resizing, blurring etc

There was an interesting discussion on MathGroup dealing with the fact that image-processing functions in Mathematica (and many other software, including Adobe Photoshop) work with RGB, Grayscale etc. ...
Alexey Popkov's user avatar
40 votes
2 answers
3k 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 ...
Jason B.'s user avatar
  • 69k
40 votes
4 answers
16k 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 ...
Emilio Pisanty's user avatar
39 votes
7 answers
20k 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 π}, Frame -> True] Is there an easy way to change the background color of the framed ...
Cassini's user avatar
  • 5,606
37 votes
4 answers
22k views

How to sort colors properly?

I can't seem to be able to sort colors by their hue and perceptual brightness correctly. Here's my current solution, but it's not right; there are all these dark bands: ...
M.R.'s user avatar
  • 31.6k
37 votes
2 answers
2k views

Specifying non-conflicting PlotTheme options

A bug or limitation in 10.0.0 affects a few of these examples; it was resolved in 10.1.0. I am trying out Mathematica 10 on https://programming.wolframcloud.com. ...
Yi Wang's user avatar
  • 7,367
35 votes
3 answers
3k 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?
Mr.Wizard's user avatar
  • 272k
35 votes
1 answer
6k 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 ...
Emilio Pisanty's user avatar
34 votes
11 answers
10k views

How to convert a hex color string to RGBColor?

For example: "#FF8000". How could I convert it to RGBColor or Hue?
matrix42's user avatar
  • 7,138
33 votes
1 answer
584 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 ...
celtschk's user avatar
  • 19.2k
31 votes
3 answers
11k views

How to plot an emission spectrum?

If I have a list of data with various wavelengths in nanometers, how would I plot them on a graph so it looks like this: So far I have managed to plot a spectrum in ...
Ali Caglayan's user avatar
30 votes
4 answers
18k 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 ...
Guillochon's user avatar
  • 6,137
29 votes
3 answers
3k views

How to change ColorFunction after plotting

Say I have a plot like plot = DensityPlot[ Exp[-((x-5)^2+(y-5)^2)/5^2], {x, 0, 10}, {y, 0, 10}, PlotRange -> {0,1} ] Is there a way to ...
Eli Lansey's user avatar
  • 7,519
28 votes
5 answers
1k 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]]]. ...
DumpsterDoofus's user avatar
27 votes
4 answers
2k 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 ...
Szabolcs's user avatar
  • 236k
26 votes
3 answers
8k views

What's the default colormap (or color scheme) used in mathematica?

For example, the colors used on this page: http://reference.wolfram.com/language/ref/ContourStyle.html or here: https://www.wolfram.com/mathematica/new-in-10/plot-themes/default.html or here: ...
Alex's user avatar
  • 363
26 votes
3 answers
6k views

Mathematica color schemes for the colorblind

Does Mathematica have a graphics option that makes plots intelligible for people with colorblindness?
user14717's user avatar
  • 827
26 votes
2 answers
8k 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 ...
Andrew's user avatar
  • 10.6k
25 votes
5 answers
18k views

How to change default notebook background color?

How does one change the default notebook background color?
Tim's user avatar
  • 395
25 votes
4 answers
6k 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], it ...
Sulli's user avatar
  • 2,215
24 votes
5 answers
2k views

Morphing Graphics, color and location

I would like to make a small animation : 1-We start with a random distribution of gray points : ...
500's user avatar
  • 5,579
24 votes
3 answers
1k 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 ...
Alexander Gruber's user avatar
24 votes
2 answers
2k 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: <...
Francisco's user avatar
  • 609
23 votes
2 answers
10k 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 ...
dearN's user avatar
  • 5,351
23 votes
1 answer
938 views

Color scheme used by Colorize?

The Colorize function is often used to display the results produced by MorphologicalComponents: ...
cormullion's user avatar
  • 24.3k
22 votes
3 answers
4k views

All that doesn't glitter isn't gold

I would like to color some objects in metallic shades like gold and silver. Various web sources suggest that the gold is a variant of yellow with RGB values 83.14% red, 68.63% green, and 21.57% blue. ...
bill s's user avatar
  • 69.3k
22 votes
3 answers
2k views

White balance correction with Mathematica

Does Mathematica include a function to correct the white balance of an image? ImageAdjust would seem to be the first go-to choice, but I haven't found a way to ...
shrx's user avatar
  • 7,817
21 votes
5 answers
5k views

Colormaps for linear visual perception AND grayscale printing

There are already good approaches for "better than standard" colormaps in Mathematica, which are optimized for a more linear perception between the visible colors and their underlying values, here in ...
DPF's user avatar
  • 1,077
21 votes
2 answers
3k 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 ...
mrz's user avatar
  • 11.7k
21 votes
2 answers
684 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 ...
Mechanical snail's user avatar
21 votes
3 answers
4k 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 ...
Zviovich's user avatar
  • 9,308
21 votes
4 answers
2k 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 ...
Russ Lyons's user avatar
20 votes
3 answers
21k 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 plot ...
Mechanical snail's user avatar
20 votes
2 answers
387 views

Color Blend in BezierCurve

How can I color a BezierCurve from Red into Green just as ...
Murta's user avatar
  • 26.3k
19 votes
6 answers
8k 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: ...
F'x's user avatar
  • 10.8k
19 votes
2 answers
2k 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: ...
Joe's user avatar
  • 1,471
19 votes
1 answer
401 views

Break[] inside ColorFunction

Bug introduced in V8.0 or earlier and persisting through V12.1.0 or later. Fixed in V13.0.0 ...
ssch's user avatar
  • 16.6k
18 votes
6 answers
3k 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, black, ...
Po-Jen Lai's user avatar
18 votes
4 answers
1k views

Quirk in VertexColors interpolation when displaying Polygon

When using VertexColors, the docs state: The interior of the polygon is colored by interpolating between the colors specified by ...
jVincent's user avatar
  • 14.8k
18 votes
4 answers
5k views

Discrete ColorData scheme with n colors?

I am trying to visualize a problem I am working on. For this, I need $n$ distinct colors which are preferably easy to distinguish. (Obviously, the higher the $n$ is, the harder it is to distinguish ...
BoZenKhaa's user avatar
  • 479
18 votes
1 answer
956 views

Is ColorDistance symmetric?

Is the function ColorDistance symmetric, i.e. is it always true that ColorDistance[a,b] == ColorDistance[b,a], as use of the ...
Szabolcs's user avatar
  • 236k
18 votes
1 answer
418 views

Color degrades when using Copy As Bitmap

I have discovered a problem that affects my use of Mathematica. When I use the menu command Edit > Copy As > Bitmap the colors in the copy are subtly degraded. To make this more apparent I copied ...
Mr.Wizard's user avatar
  • 272k

1
2 3 4 5
26