Tag Info

Hot answers tagged

12

Update 2: The content and organization of $PlotThemes in versions 10 and 9 are very different. In Version 10 Charting`$PlotThemes gives whereas in Version 9, the content is organized around Charting/Plotting functions (See the picture in original post below.) The color schemes can be obtained using: "Color"/. Charting`$PlotThemes (* ...


9

The colors alone are indexed color scheme #97: ColorData[97, "ColorList"] The colors are returned as plain RGBColor expressions; the colored squares are merely a formatting directive. You can still see the numeric data with: ColorData[97, "ColorList"] // InputForm {RGBColor[0.368417, 0.506779, 0.709798], . . ., RGBColor[0.28026441037696703, 0.715, ...


8

To get an easily distinguishable scale of grays, you could do ArrayPlot[{Table[x, {x, 0, .9, .1}]}, AspectRatio -> .3] To get 256 shades of gray ArrayPlot[{Table[x, {x, 1/256, 1, 1/256}]}, AspectRatio -> .3] To get 1024 shades of gray ArrayPlot[{Table[x, {x, 1/1024, 1, 1/1024}]}, AspectRatio -> .3] I exported this as a tiff (usual ...


7

Its not true that a human can not see banding in 256 colors. Whether or not you do depends quite much on what the transfer curve of the monitor is and if its a low quality LCD with diminished color spectrum, like in many phones. Also human eyes are really well adapted to sensing just this kind of thing so while 256 colors in general is fine its not so good ...


6

I would use MeshShading, as shown in the documentation for ParametricPlot3D: ParametricPlot3D[{x, y, x^2 + y^2 - 5}, {y, -3, 3}, {x, -3, 3}, MeshShading -> {Directive[Opacity[.8], Blue], Directive[Opacity[.8], Yellow]}, Mesh -> {{0}}, MeshFunctions -> {#3 &}, BoundaryStyle -> {Black, Thickness[.01]}, Lighting -> "Neutral"]


5

SeedRandom[4]; pts = Table[{x, y, 0.25 + UnitStep[30 - Abs[x] - 0.001] UnitStep[50 - Abs[y] - 0.001] (0.25/RandomReal[{0.1, 2}]^2)}, {x, -30, 30, 5}, {y, -50, 50, 5}]; ParametricPlot3D[ BSplineFunction[pts, SplineDegree -> 2][u, v], {u, 0, 1}, {v, 0, 1}, PlotRange -> All, Boxed -> False, Axes -> False, Mesh -> None, ...


3

You can use SyntaxInformation. In this case, SyntaxInformation[Lim] = {"ArgumentsPattern" -> {_, _, OptionsPattern[]}, "LocalVariables" -> {"Limit", {2}}} does what you want.


3

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

ParametricPlot[ {Re@Sin[u + I v], Im@Sin[u + I v]}, {u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2}, ColorFunction -> (ColorData["TemperatureMap"][Abs[2 #3/Pi]] &), ColorFunctionScaling -> False, ImagePadding -> 20, ImageSize -> 400, PlotPoints -> 30, Mesh -> Automatic] ParametricPlot[ {Re@Sin[u + I v], Im@Sin[u + I v]}, {u, -Pi/2, ...


3

Something like this? data2D = Import["http://pastebin.com/raw.php?i=0Liw8F1r", "NB"]; data4D = Import["http://pastebin.com/raw.php?i=zgrCRiQh", "NB"]; Find min and max values for the color data {min, max} = {Min[#], Max[#]} &@data4D[[All, -1]]; Now, I place a color in front of each polygon (like {color1, polygon1, color2, polygon2, ...}) when ...


2

Column[Framed@Graphics[Raster[{Range@#/#}, ColorFunction -> (Blend[{{0, White}, {1, Black}}, #] &)], AspectRatio -> 0.2, ImageSize -> 400] & /@ {3^2, 3^3, 3^4, 3^5}]


2

I just take the value of the pixel in the middle of the tile, if you want the mean value of the whole tile just use Mean@Flatten[ImageData[#], 1] & /@ p. s = Import["http://i.stack.imgur.com/ubuPp.jpg"]; p = Flatten[ImagePartition[s, {50, 69}], 1] colors = PixelValue[#, .5*ImageDimensions@#] & /@ p; GraphicsRow@{p[[1]], ...


2

You could do ParametricPlot[ {Re@Sin[u + I v], Im@Sin[u + I v]}, {u, -Pi/2, Pi/2}, {v, -Pi/2, Pi/2}, ColorFunction -> (ColorData["DarkRainbow"][If[#3 < .5, 1 - #3, #3]] &), ImagePadding -> 20, ImageSize -> 400, PlotPoints -> 30]


2

{min, max} ={-10, 10}; h2 = ParametricPlot3D[lst, {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False, ColorFunction -> (Function[{x, y, z, u, v}, Hue[Rescale[dam, {0, 1}]]]), ColorFunctionScaling -> False, ImageSize -> 800, PlotLegends -> BarLegend[{Hue, {min, max}}, ColorFunctionScaling -> True]] or Legended[h, ...


2

Does the following: h = ParametricPlot3D[lst, {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False, ColorFunction -> (Function[{x, y, z, u, v}, Hue[Rescale[dam, {0, 1}]]]), ColorFunctionScaling -> False, ImageSize -> 800]; g = Plot3D[Rescale[dam, {0, 1}], {u, 0, 2*Pi}, {v, 0, Pi}, Mesh -> False, ColorFunction -> (Function[{u, v, z}, ...


2

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


2

Try this fns = Table[x^n, {n, 0, 5}]; Plot[fns, {x, -1, 1}, PlotTheme -> None] Plot[fns, {x, -1, 1}, PlotTheme -> None]


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]


1

You need to tell Mathematica how you want clipping handled. f[x_, y_] = 2*(x^2 - y^2)/(x^2 + y^2)^2 - 1/(x^2 + y^2)^2 // Simplify; Plot3D[f[x, y], {x, -3, 3}, {y, -3, 3}, PlotRange -> {-1, 1}, ClippingStyle -> None] DensityPlot[f[x, y], {x, -3, 3}, {y, -3, 3}, PlotPoints -> 100, ColorFunction -> "TemperatureMap", ClippingStyle ...


1

lst = {10*Cos[u]*Sin[v], 3*Sin[u]*Sin[v], 2*Cos[v]}; dam = FullSimplify@ Sqrt[(1296*Cos[u]^4* Sin[v]^4)/(900*Cos[v]^2 + 36*Cos[u]^2*Sin[v]^2 + 400*Sin[u]^2*Sin[v]^2)^2 + (3600*Cos[u]^2* Sin[v]^2*(9*Cos[v]^2 + 4*Sin[u]^2*Sin[v]^2))/(900*Cos[v]^2 + 4*(9*Cos[u]^2 + 100*Sin[u]^2)*Sin[v]^2)^2]; Add FullSimplify in dam, so ...


1

As an alternative you could also color your ellipsoid f.e. by its mean curvature: mcur = (a b c (3 (a^2 + b^2) + 2 c^2 + (a^2 + b^2 - 2 c^2) Cos[2 v] + 2 (-a^2 + b^2) Cos[2 u] Sin[v]^2))/( 8 (a^2 b^2 Cos[v]^2 + c^2 (b^2 Cos[u]^2 + a^2 Sin[u]^2) Sin[v]^2)^(3/2)); Plug in your parameters: dam = mcur /. {a -> 10, b -> 3, c -> 2} // ...



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