Tag Info

New answers tagged

1

Starting from this Plot3D: Plot3D[ Exp[-x^2 - y^2], {x, -3, 3}, {y, -3, 3}, PlotPoints -> 100, PlotRange -> {0, 1}, PlotRangePadding -> None, Mesh -> None, PlotPoints -> 50, BoxRatios -> {1, 1, 1}, Boxed -> False, AxesLabel -> Automatic, ViewPoint -> {-2, -2, 3} ] let me address the question of how to use ...


3

You can add Specularity to the ColorFunction. Here is a Manipulate you can play with to figure out what settings you prefer: Manipulate[ Plot3D[Exp[-x^2 - y^2], {x, -3, 3}, {y, -3, 3}, PlotPoints -> 50, PlotRange -> All, PlotRangePadding -> None, ColorFunction -> (Directive[Specularity[s, 20], Glow@ColorData["DarkRainbow"][#3]] ...


0

You can set the colours with the option PlotStyle, for example: ListPlot[{data1, data2, data3, data4}, PlotRange -> Automatic, PlotStyle -> {Green, Red, Blue, Yellow}] This makes the first set green, the second one red, the third one blue, and the fourth one yellow. There are also other things you can change, e.g. the size of the points: ...


0

What you want might be satisfied by something as simple as ListLinePlot[conn, PlotStyle -> {{Red, Dashing[Large]}}, PlotLegends -> LineLegend[{"Entity"}]]


0

Not sure if I understand your question, but here's my approach: ListLinePlot[conn , PlotStyle -> { {Red, Dashing[{3, 3}/100]} , {Red, Dashing[Tiny]} } , Frame -> True , PlotLegends -> Automatic]


0

Alternately, if you're just planning on using the barebones function Image, you could do something like this: col = Compile[{{z, _Real}}, {Sign[z]/4 + 1, Exp[1 - Max[Abs[z], 1]], Min[Abs[z], 1]}, RuntimeAttributes -> {Listable}] which produces a basic red-blue color scheme in Hue colorspace. Example usage: Image[hue@Table[Sin[x] Sin[y], {x, 0, 10, ...


1

Use ColorFunction. Plot[Sin[500 x], {x, 0, 1}, ColorFunction -> Function[{x, y}, Piecewise[ {{RGBColor[0, 0, 1 - 2 y], 0 <= y < .5}, {RGBColor[2 (y - .5), 0, 0], .5 <= y <= 1}} ] ] ] A bit ugly, but you get the idea. Here the line of the plot is colored based on the y coordinate. The ...


2

You can also do this via the Format-> Option Inspector, Choosing your context (Selection, sheet or Global) and looking for UndefinedSymbolStyle in the lookup box.


4

You can change CurrentValue[EvaluationNotebook[], {AutoStyleOptions, "UndefinedSymbolStyle"}] (* {FontColor -> RGBColor[0., 0.173, 0.765]} *) to any color of your choice, say Red, evaluating CurrentValue[EvaluationNotebook[], {AutoStyleOptions, "UndefinedSymbolStyle"}] = {FontColor -> RGBColor[1., 0., 0.]} anywhere in the notebook. Before ...


7

Simple white balance As described in the Wikipedia article, the simplest white balance is to rescale the RGB channels to make white objects have white pixels. Here's a simple method where I define a white point in the original image by the 0.995 quantile of each colour channel: image = Import["http://i.stack.imgur.com/bUvXg.png"]; white = Quantile[#, ...


13

Histogram Mean Color Balance Your example photographs imgList = Import /@ {"http://i.imgur.com/qzFttRD.jpg", "http://i.imgur.com/fh9tAK1.jpg", "http://i.imgur.com/b2kWM3y.jpg", "http://i.imgur.com/amNRIhh.jpg"}; ImageAssemble[imgList~Partition~2] The following code balances the colors of an image by transforming the histogram ...


3

A possible alternative to DensityPlot is to render an Image: (* kguler's example function *) f[x_, y_] := {Sin[x] Sin[y], Sin[3 x] Cos[2 y], Cos[y/Pi] Sin[x + y]} Array[f, {100, 100}, {{-2 Pi, 2 Pi}, {-2 Pi, 2 Pi}}] // Transpose // Reverse // Rescale // Image // ImageResize[#, 300] & Here is a self-contained function that evaluates a function ...


2

ClearAll[f] f[x_, y_] := {Sin[x] Sin[y], Sin[3 x] Cos[2 y], Cos[y/Pi] Sin[ x + y]} dp = DensityPlot[Plus @@ f[x, y], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}, Frame -> False, ImageSize -> 300] dps = DensityPlot[f[x, y][[#]], {x, -2 Pi, 2 Pi}, {y, -2 Pi, 2 Pi}, Frame -> False, ImageSize -> 300, ColorFunction -> (Function[{c}, ...


5

Here is an example of how to do it: f[x_, y_] := {Sin[x], Cos[y], Sin[2 x + y]} Block[{x, y, h, xMin = -1, xMax = 3, yMin = -3, yMax = 3}, Graphics[{}, PlotRange -> {{xMin, xMax}, {yMin, yMax}}, Epilog -> Inset[Show[ColorCombine[Table[Image[ DensityPlot[f[x, y][[i]], {x, xMin, xMax}, {y, yMin, yMax}, Frame -> None, ...


4

With caffeine as the example molecule molecule = Import["ExampleData/caffeine.xyz"] one can find all spheres that represent the single atoms using sphereList = Cases[molecule[[1, 4, 2]], _Sphere] {Sphere[1,24.],Sphere[12,24.],Sphere[14,24.],Sphere[15,24.],Sphere[16,24.],Sphere[17,24.], ...


6

Evaluating ColorData["Properties"] in 10.0.2 returns: {"AlternateNames", "ColorFunction", "ColorList", "ColorRules", "Image", "Name", "Panel", "ParameterCount", "Range", "StandardName"} This however is also incomplete. Some spelunking reveals that there are more. Here is a complete list from the function definition itself: "StandardName" "Name" ...


15

It seems that there is a significant overhead every time a color scheme is switched. Once a scheme is loaded each use is fast, but changing color schemes apparently unloads and reloads the mechanism. The result is that the speed of application is directly related to the frequency of switching. With sorted values there is only one switch and application is ...


0

Thank you for your help. I have come up with something that is almost what I am looking for: Photo = RandomReal[1, {50, 50}]; Manipulate[ ArrayPlot[Photo, ColorRules -> {y_ /; y < a -> Purple, y_ /; y < b -> Red, y_ /; y < c -> Blue}], {a, 0, 1}, {b, 0, 1}, {c, 0, 1}] What I would like to do is instead of using ArrayPlot ...


7

Here is something 10 x faster. I made the same assumption as george2079 so for each subinterval whole color scheme is used not just exact part like in Simon's answer. Maybe useful, maybe not. Usage colorF ~ createColorFunction ~ {"TemperatureMap", "AvocadoColors"}; pic = Image@ConstantArray[Range[0, 1, .001], 100] Colorize[pic, ColorFunction -> ...


3

You can use Colorize for this Colorize[RandomImage[1, {10, 10}], ColorFunction -> (Piecewise[ {{ColorData["AlpineColors"][#], 0 < # < .5}, {ColorData["SouthwestColors"][#], .5 < # < 1}}] &)]


2

One approach: ImageApply[ List @@ Piecewise[{ {ColorData["AlpineColors"][2 #], 0 < # < .5}, {ColorData["SouthwestColors"][2 # - 1 ], .5 < # < 1} }] &, Image[RandomReal[1, {10, 10}]]] or Image[Map[ List @@ Piecewise[{ {ColorData["AlpineColors"][2 #], 0 < # < .5}, ...


1

Using VectorAngle and Developer`PartitionMap: aclF[x_] := Module[{a = VectorAngle[{1, 0}, Subtract @@ x]/Pi}, {If[a >= .5, Blend[{White, Orange, Orange, Purple, Purple, White}, 2 (a - .5)], Blend[{White, Purple, Purple, Orange, Orange, White}, 2 a]], Line@x}]; Graphics[Developer`PartitionMap[aclF, #, 2, 1] & @@@ testD, Background ...


9

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] ...



Top 50 recent answers are included