Tag Info

Hot answers tagged

10

In principle the same method could be used in Mathematica. The problem boils down to determining if a solution to $a=b$ exists somewhere inside each pixel. Here's an oversimplified approach where I calculate $a-b$ for 100 random points within the pixel and see if there are both positive and negative values. If there are, there must be a zero crossing ...


8

That's the best I could go with Mathematica 10.0.2, with PlotPoints->50 and MaxRecursion->4. ContourPlot[ E^(Sin[x] + Cos[y]) == Sin[E^(x + y)], {x, -10, 10}, {y, -10, 10}, Axes -> True, ImageSize -> Large, PlotPoints -> 50, MaxRecursion -> 4] The rendering took about 1 hour with Mathematica eating all my 16Gb Ram. (I'll never try ...


6

Both options PlotTheme -> None and PlotTheme -> "Classic" don't give the expected coloring for the points. However, you can set their color explicitly using PlotStyle -> Directive[PointSize[0.03], ColorData[1][1]]: ListPointPlot3D[ Partition[Flatten[Table[l u1 + p u2 + q u3, {l, -3, 3}, {p, -3, 3}, {q, -3, 3}]], 3], PlotRange -> {{-1, 1}, ...


6

The following is a answer to the original question, without accounting for the last edit. The red plot is nice,but I'm not sure what they are trying to show. Inside the solid colored regions the frequency is very high, but the function isn't constant, as an easy check can show: f[x_, y_] := Exp[Sin[x] + Cos[y]] - Sin[Exp[x + y]] GraphicsRow[{Plot[f[x, 5], ...


5

As far as I know there is no documented list of Method options for ContourPlot and DensityPlot. If you want to experiment there is a large list of strings in Charting`CommonDump`$VisualizationMethodOptions to have a look at. Some of these are option settings, some are option values. Most seem to have no effect on a simple ContourPlot and probably apply to ...


5

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


5

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


5

if I understand you correctly you have the plot not the data. you need to extract the data from the plot and then (as belisarius mentioned) use interpolation. Example: p = Plot[Sin[x], {x, 0, 2 \[Pi]}]; data = Cases[p, Line[{x__}] :> x, -1]; d = D[Interpolation[data][x], x]; Plot[d, {x, 1, 2 \[Pi]}]


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


3

data=Compile[{},With[{y=Range[-10,10,0.006]}, Table[UnitStep[(E^(Sin[x]+Cos[y])-Sin[E^(x+y)])],{x,y}]]][];//AbsoluteTiming ArrayPlot[data,DataReversed->True]


3

Thanks. I ended up using region = ImplicitRegion[ Or[0 < x < 1 && -1 < y < 1, -1 < x < 1 && 0 < y < 1], {x, y}] NDSolveValue[{Laplacian[u[x, y], {x, y}] == -1, DirichletCondition[u[x, y] == 0, True]}, u, {x, y} ∈ region] Plot3D[%[x, y], {x, y} ∈ region]


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


3

The problem seems to be the setting "DefaultPlotStyle" -> Automatic in the Method option in the plot theme: Charting`ResolvePlotTheme["Classic", ListPointPlot3D] (* {AxesStyle -> Directive[GrayLevel[0], AbsoluteThickness[0.2]], BaseStyle -> Automatic, FaceGridsStyle -> Automatic, LabelStyle -> {FontFamily -> "Times"}, Method ...


2

If you must use ListPlot, then perhaps you should make two or three separate plots and align them one atop the other. A better way is to use ListLogPlot, however: ListLogPlot[{data1, data2, data3}, Joined -> True, PlotMarkers -> {Automatic, 15}, PlotRange -> {0.000001, 0.8}, PlotLegends -> Placed[LineLegend[{"data1", "data2", ...


2

Still crashes the kernel in version 10.0.2. The reason seems to be that the points don't lie on a regular grid: The command ListVectorPlot[ Table[{{x, -y}, {-y, x}}, {x, -3, 3, 0.5}, {y, -3, 3, 0.5}], VectorPoints -> All] works, but the command ListVectorPlot[ Table[{{x, -y + 0.01*x}, {-y, x}}, {x, -3, 3, 0.5}, {y, -3, 3, 0.5}], VectorPoints -> ...


2

With your parameters param1 = {1.56894, 0.548273, 0.548273}; param2 = {5.04353, 0.974998, 0.974998}; param3 = {9.79371, 1.28185, 1.28185}; param4 = {1.96894, 0.748273, 0.348273}; param5 = {5.34353, 0.174998, 0.774998}; param6 = {9.39371, 1.48185, 1.98185}; and a txt-file with the same structure as Export["parameter.txt", {param1, param2, param3, param4, ...


2

A slice of the function Plot[scaled\[Phi][A, .2, mdfun[x, 11.35], 1, 0.1, hx[x, 11.35], 0.05, -5], {x, 0, 3}] suggests that the irregular contours and long running time are due to the fine structure of mdfun. Averaging over the fine structure before generating the ContourPlot may give smoother contours, if details of the fine structure are not needed ...


2

Your mapping is not continuous and the mesh just shows it. fun1[u_, v_] := 2 - Norm[{u, v}]*Cos[Mod[ArcTan[v, u], Pi/3, -Pi/6]] ParametricPlot3D[{u, v, fun1[u, v]}, {u, -1, 1}, {v, -1, 1}, RegionFunction -> (1.2 < fun1[#4, #5] < 1.7 &), PlotPoints -> 50]


2

Supposing you import the file so that it produces the following structure.. data = { {"2014-12-11T16:13:13.038337Z", 3.90092}, {"2014-12-11T16:14:13.456558Z", 3.89734}, {"2014-12-11T16:15:12.444318Z", 3.90092}} You would then be best off converting it to a TimeSeries object which is fairly clever about parsing dates automatically. ts = ...


2

You have to add the option PlotRangePadding -> 0 to Show. Show[SmoothHistogram[RandomVariate[ExponentialDistribution[1/2], 500], Filling -> Bottom], PlotRangeClipping -> True, PlotRange -> {{0, 10}, Automatic}] Show[SmoothHistogram[RandomVariate[ExponentialDistribution[1/2], 500], Filling -> Bottom], PlotRangeClipping -> True, ...


1

One should not be confused with method or option. A method in the sense of Mathematica (See: Method) Options in the sense of Mathematica (See: Options) For DensityPlot or ContourPlot you can query for Options with ??DensityPlot or with ??ContourPlot: The Link provided by @Karsten 7. (answer by @Nasser), is a really fabulous strategy to "unearth" ...


1

Manipulate[ PolarPlot[{1, a + Sin[3 θ]}, {θ, 0, 2 π}, PlotRange -> {{-3.5, 3.5}, {-4, 3.2}}], {a, -3, 3}]


1

In Mathematica 10: domain= ImplicitRegion[0 <= x <= 1 && -1 <= y <= 1 || -1 <= x <= 1 && 0 <= y <= 1, {x,y}]; sol = NDSolveValue[{D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == -1, DirichletCondition[u[x, y] == 0, True]}, u, Element[{x, y}, domain]]; Plot3D[sol[x, y], Element[{x, y}, domain]]


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


1

This demo allows the user to set x- minimum and maximum. It uses Initialization and local variables x1 and x2 to store the values so when the notebook is reopened in another session the last saved inputs are still present. Panel[DynamicModule[{f = x^2 + 3, x1 = -10, x2 = 10}, Column[{ Row[{"function ", InputField[Dynamic[f]]}], Row[{"x min = ", ...



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