Tag Info

Hot answers tagged


Notice: Simon Woods did just this months ago for an answer I missed: Convert spectral distribution to RGB color It seems that it can. By spelunking ChromaticityPlot I found: Image`ColorOperationsDump`$wavelengths Image`ColorOperationsDump`tris These are a list of wavelengths and their corresponding XYZ color values used by this plot command: ...


Most of your lines are "multipoint" and your color function doesn't support them well. You can enforce "two points lines" by doing something like this (I'm following your map code styling here): Show[Graphics[{AngleColor[#[[2]] - #[[1]]], Line[#]}] & /@ Partition[#, 2, 1] & /@ # & /@ testD, Background -> Black, ImageSize -> 800] ...


Using Graph instead of GraphPlot you get many convenient options for styling as shown in @ubpdqn's answer. If you have to use GraphPlot: You can use the option PlotStyle->Black to get black edges. To style the vertices you can post-process the output to change Text primitives into graphics primitives of your choice. For example: el={1 -> 2, 2 ...


im = ExampleData[{"TestImage", "Aerial"}]; Colorize[im, ColorFunction -> "AvocadoColors"] // Timing // First (* 0.093750 *) versus ImageApply[List @@ ColorData["AvocadoColors"][#] &, im] // Timing // First (* 0.265625 *) ImageApply[List @@ Blend["AvocadoColors", #] &, im] // Timing // First (thanks: @Kuba *) (* 0.109375 *) For a larger ...


mycf[z_] := Piecewise[{ {ColorData["Rainbow"][-z/2], z <= 0}, {ColorData["SouthwestColors"][z], z > 0}}] Plot3D[Sin[x] + Sin[y], {x, -Pi, Pi}, {y, -Pi, Pi}, ColorFunction -> mycf, ColorFunctionScaling -> False]


Raster will be helpful, as it has the ColorFunction option and it can be directly converted back to an Image. Let img be a grayscale image: img = ColorConvert[ExampleData[{"TestImage", "Lena"}], "Grayscale"] Image@Raster[ImageData[img, DataReversed -> True], ColorFunction -> "Rainbow"]


Here's how you could add a gamma correction: Clear[gamma]; gamma[x_?NumericQ, ɣ_] := x^(1/ɣ); MyScale = gamma[#, 4] &; In your colorbar you plot MyScale@y and in the plot ColorFunction you have MyScale@height, and then:


Here's my mathematical rainbow spectrum plot. I'm not sure how accurate it is, and I did not attempt to calibrate it with measured data; but it's the smoothest, best looking spectrum I've seen, so I thought I would post it here. Large images: http://sam.nipl.net/pix/spectrum.png http://sam.nipl.net/pix/spectrum2.png Reasoning: All colours in the ...

Only top voted, non community-wiki answers of a minimum length are eligible