Tag Info

Hot answers tagged

5

There are some place which can be optimized in your animation. When I see this right, then your function Outer[(-Mod[#1, #2]/#2) &, # + k, #] & is similar to Outer[(-Mod[#1+k, #2]/#2) &, #, #] & but the latter has the big advantage, that the calculation of your Outer does not rely on k. It is even better than that, because now we can ...


4

The fastest way to plot large data in my experience is Image, as I do here: Animate[Prime[Range[400]] // Outer[(-Mod[#1, #2]/#2) &, # + k, #] & // Column@{Style[k, Large], Colorize[Image[Transpose@Rescale@#, ImageSize -> 600], ColorFunction -> "LakeColors"]} &, {k, 1, 1000, 1}, AnimationRate -> 1]


4

You can also use ColorCombine: When combining a color image with a grayscale image, ColorCombine creates an image of the same color space with alpha channel. f1 = With[{dt = #, max = Last@Dimensions[#]}, ColorCombine[ {Image[MapIndexed[List @@ ColorData[{"Rainbow", {1, max}}][Last@#2] &, dt,{2}]], Image[dt]}, "RGB"]] &; data = ...


4

data = RandomReal[1, {30, 30}]; ImageMultiply[LinearGradientImage[{Blue, Red}, {30, 30}], Image[data]]


4

Although InputForm for these plots is enormous, due to the InterpolatingFunctions used, Cases[asl, GraphicsComplex[x__]] allows the data associated with Arrow and Arrowheads to be isolated. Doing so shows that the data for most contours runs right to left, but for a few from left to right. A work-around is as follows. Determine the Position of the ...


3

Along the lines of Rahul's comment: Two possible methods: If the function f is differentiable, the compare the directions of the Grad of f with the (2D) Cross of the direction of the line. Use the Cross of the direction of the line to determine which side of the contour has the higher value of f by comparing the value of f on contour with a point on the ...


3

Here is a graph based solution. However the result (the pixels) will be dependent on resolution, and this solution currently uses the lowest resolution possible. withinRange[range_][pt1_, pt2_] := Norm[pt1 - pt2] <= 2 range adjacencyMatrix = Boole@Outer[withinRange[3.5], points, points, 1] -IdentityMatrix@Length@points; Some work may be saved by only ...


3

It's a little hard to be sure this is exactly what you are looking for, but at least it's a start. First, make the gradient image: rainbowImg=Image[Colorize[Image[Rescale[Table[j, {i, 1, 100}, {j, 1, 100}]]], ColorFunction -> "Rainbow"]] Then take the data image and use it as an alpha channel to allow it to specify the brightness of the resulting ...


2

I would work purely on the list of points. You have the radius r, so you can easily identify connected regions with points = {{27, 38}, {31, 50}, {33, 56}, {34, 38}, {39, 51}, {39, 63}, {40, 31}, {42, 45}, {42, 55}, {47, 27}, {47, 50}, {48, 35}, {48, 65}, {49, 43}, {52, 57}, {54, 50}}; data = ReplacePart[ConstantArray[0., {96, 145}], points -> ...


1

The code from the previous question's answer seems to work just as well here with the use of SwatchLegend: Legended[GraphicsGrid[{{Graphics[box1], Graphics[box2]}}], Placed[SwatchLegend[56, {"A", "B"}, LegendLayout -> "Row"], Above]]



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