Tag Info

New answers tagged

6

Here are three progressively more intrusive steps to troubleshoot Mathematica. Hold down Shift-Control (Shift-Command on Mac) while starting Mathematica, as described here. If this didn't fix the problem, move to the next step. Evaluate SystemOpen[$UserBaseDirectory]. This will reveal the directory where Mathematica keeps all its settings, packages, ...


11

I got my CIE color matching functions from here. These are the CIE 1931 2-deg, XYZ CMFs modified by Judd (1951) and Vos (1978). {λ, x, y, z} = Import["http://www.cvrl.org/database/data/cmfs/ciexyzjv.csv"]\[Transpose]; ListLinePlot[{{λ, x}\[Transpose], {λ,y}\[Transpose], {λ, z}\[Transpose]}, PlotLegends -> {"X", "Y", "Z"}] Conversion of color ...


7

I thought I'd share my attempt at this, even though it doesn't seem to have worked properly. The CIE color matching functions are tabulated in the Image`ColorOperationsDump context which is used by ChromaticityPlot. The context can be loaded by calling ChromaticityPlot and then we can interpolate the data to obtain functions: ChromaticityPlot["RGB"]; {x, ...


4

Just for fun, try this ControllerManipulate[ RegionPlot[True, {x, 1, 4}, {y, 1, 4}, ColorFunctionScaling -> False, ColorFunction -> Function[{x, y}, Block[{d = Norm[l - #]}, RGBColor[1 - d/(1 + d), 0, d/(1 + d)]] & @{x, y}]], {{l, {2, 2}}, Locator, Appearance -> None}]


3

Since as far as I can tell the Drawing Tools palette always uses the system (e.g. Windows) color picker I don't think it is (presently) possible to solve your first question. Your second question has more possibility: Is there a way to change the colours of objects made with Drawing Tools that will allow me to enter the C, M, Y, K values into input ...


2

It seems to me that there are two natural approaches: (1) modifying color rules before the panel is created or (2) post-processing the output to replace recognizable colors. belisarius already showed a method for the second so I shall address the first. Modifying the color rules The color rules are loaded through this call: ...


12

I know you said you didn't want to reinvent the wheel, but sometimes, it's fun to do so. The code below creates a palette with a Periodic Table and a few buttons to make useful tool tips. It shows how one might change the colors based on properties grabbed from ElementData. Note that this code was written for version 9, and if you wish to use it in ...


6

This example picks the colors according to atomic weight, which are loaded from ElementData[]. Like belisarius's answer, it generates a list of rules to replace colors which is then applied to the pane. Rule @@@ Transpose[{ColorData["Atoms", "ColorList"] , ColorData["NeonColors"][QuantityMagnitude@ElementData[#,"AtomicMass"]/200] & /@ ...


14

myAtoms = {"H", "Li", "Na"}; defCols = myAtoms /. ColorData["Atoms", "ColorRules"]; newCols = {Pink, Yellow, LightBlue}; ColorData["Atoms", "Panel"] /. Thread[defCols -> newCols] Edit: Changing the font color isn't related to the ColorRules, but to the special formatting used by the Panel. So it's cumbersome, but you can see that Mma uses a similar ...


5

Like you, I found no colours in the output *.pov file. Mathematica recognises the pov extension, but Export["povtest.pov",pplot3D] outputs all triangle objects with white colour: pigment {color rgb <1, 1, 1>}. I took the brute-force approach and decomposed the 3D plot into vertices, triangles, and colours. Define the 3D plot. pplot3D = ...


2

For ease of direct access I have found through digging the following relationships for indexed colors: map = {"Default" -> 97, "Earth" -> 98, "Garnet" -> 99, "Opal" -> 100, "Sapphire" -> 101, "Steel" -> 102, "Sunrise" -> 103, "Textbook" -> 104, "Water" -> 105, "BoldColor" -> 106, "CoolColor" -> 107, "DarkColor" -> ...


2

Look at some candiates: Grid[Partition[ Show[ColorData[#, "Image"], ImageSize -> 110] & /@ (cd = ColorData["Gradients"]), 4, 4, 1, {}], Spacings -> .5] Number 47 looks interesting... cd[[47]] ColorData[%, "Image"] (* SunsetColors *)


2

So you can either pick one here: {#, ColorData@#} & /@ ColorData["Gradients"] // Short or create your own with Hue: col = Function[Blend[{Black, Hue@.05, Hue@.15, White}, Slot[1]]] or by naming the colours you want: col1 = Function[Blend[{Black, Red, Orange, Yellow, White}, Slot[1]]] ListDensityPlot[Table[1/(x^2 + y^2), {x, -2, 2, 4/51}, {y, ...


0

SeedRandom[1]; pts = RandomReal[1, {100, 3}]; i = 1; ListPointPlot3D[List /@ pts, BaseStyle -> PointSize[Large], PlotStyle -> Table[Blend[{Yellow, Brown}, i++/Length[pts]], {Length[pts]}]]


1

pts = RandomReal[1, {10, 3}]; ListPointPlot3D[pts, PlotStyle -> PointSize[Large], BoxRatios -> {1, 1, 1}, PlotRange -> {{0, 1}, {0, 1}, {0, 1}}, ColorFunction -> Function[{x, y, z}, Blend[{Yellow, Brown}, Position[pts, {x, y, z}][[1, 1]]/Length[pts]]], ColorFunctionScaling -> False]


4

Using VertexColors is efficient if there are many points. SeedRandom[1]; pts = RandomReal[1, {100, 3}]; Post-process ListPointPlot3D: ListPointPlot3D[pts, PlotStyle -> PointSize[Large]] /. Point[pp_] :> Point[pp, VertexColors -> (Blend[{Yellow, Brown}, #] & /@ Rescale@Range@Length[pp])] Or directly with Graphics3D: ...


3

In V10, with the new association objects, it is easy to implement what you want with ListPointPlot3D What is needed is a hash map (which is my mental image of an association) that maps your list of points into index values for Blend. This can be built with AssociationThread. Consider pts = RandomInteger[99, {100, 3}]; indxs = AssociationThread[pts, Range @ ...


3

Doing this with ListPointPlot3D is not very straightforward, but do look at the answer by m_goldberg. However, ListPointPlot3D is trivial to re-implement in terms of graphics primitives. Here's one way to colour based on index: pts = RandomReal[1, {10, 3}]; Graphics3D[ {PointSize[Large], MapIndexed[{Blend[{Yellow, Brown}, First[#2]/Length[pts]], ...



Top 50 recent answers are included