Hot answers tagged

11

legend = Import["https://i.imgur.com/onzvkyP.png"]; (* extract a slice of columns containing the colours. Rotate the legend on its side. *) legadjusted = ImageRotate[ImageCrop[ImageTake[legend, All, {40, 45}]], -Pi/2]; (* we generate a list of points that fall in between the boxes in the legend *) coords = Table[{x, 5}, {x, 16, 398, 9.5}]; (* ...


10

You can use the Antialiasing option to get what you want: image = Graphics[ { Red, Triangle[{{0, 0}, {1, 0}, {0, 1}}], Blue, Triangle[{{1, 0}, {2, 0}, {2, 1}}], Green, Triangle[{{2, 1}, {2, 2}, {1, 2}}], Yellow, Triangle[{{1, 2}, {0, 2}, {0, 1}}] }, BaseStyle -> Antialiasing -> False ] Rasterize@image


6

I think for both methods, a better solution would be to use RegionFunction to restrict the plotting region: ListVectorDensityPlot[mydata, DataRange -> {{-1.2, 1.2}, {-1.2, 1.2}}, PlotRange -> Full, PlotRangeClipping -> False, RegionFunction -> (-1.2 <= #1 <= 1.2 && -1.2 <= #2 <= 1.2 &), VectorColorFunction -> ...


2

Get the palette in RGB: RGBpalette = (List @@ ColorConvert[Hue[##], "RGB"]) & @@@ palette Get the convex hull in RGB, and pick only those colors on the boundary—we'll use these for interpolation: region = ConvexHullRegion[RGBpalette] generators = Select[(List @@@ RGBpalette), RegionMember[RegionBoundary@ConvexHullRegion[List @@@ ...


2

It is difficult to understand how ListVectorDensityPlot[] works in this case. But for my opinion for some presentation it could be better to use something less rainbow, for instance, ListVectorDensityPlot[mydatanormalized, DataRange -> {{-1.2, 1.2}, {-1.2, 1.2}}, PlotRange -> Full, PlotRangeClipping -> False, VectorColorFunction -> None, ...


2

Clear["Global`*"] SphericalHarmonicY[1, 0 , θ, Φ] is real for real {θ, Φ} FunctionDomain[ SphericalHarmonicY[1, 0, θ, Φ], {θ, Φ}] (* True *) The min and max values are {min, max} = #[{Re@SphericalHarmonicY[1, 0, θ, Φ], 0 <= θ <= Pi, 0 <= Φ <= 2 Pi}, {θ, Φ}] & /@ {MinValue, MaxValue} (* {-(Sqrt[(3/π)]/2), Sqrt[3/...


1

thegrid = Column[{Text[ Style["Table of Squares and Cubes", FontFamily -> "Comic Sans MS", FontSize -> 14, FontWeight -> Bold]], Grid[Prepend[ Table[{Style[n, Black], Style[n^2, Blue], Style[n^3, If[n <= 15, Green, Red]]}, {n, 1, 50}], {n, n^2, n^3}], Frame -> {All, {1}}, FrameStyle ...


1

Specify the index for the color desired. Clear["Global`*"] testdata = Table[Around[i^2, i], {i, 10}]; colors = ColorData[97, "ColorList"]; direc = Directive[#] & /@ colors; index = RandomInteger[{1, Length@colors}] (* 11 *) specifyAll = ListPlot[testdata, PlotStyle -> colors[[index]], IntervalMarkersStyle -> colors[[...


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