Hot answers tagged

7

Try this ContourPlot[Cos[x - y] + Sin[x^2 + 3 y], {x, -3, 3}, {y, -3, 3}, PlotTheme -> "Monochrome",ContourStyle -> Directive[White, Opacity@.1]] You can also use ColorFunction -> ColorData["GrayTones"] for gray shades or even write your own following the reference.


4

As Sjord C. de Vries says in the comments the required stencils can be made with the standard graphics functions. Probably it is better or easier to use some of the new Region and finite element functions. 2D grid Here is code using Graphics primitives: points = Table[{i, j}, {i, 1, 6}, {j, 1, 5}]; grid = Join[ Map[Line /@ Partition[#, 2, 1] &, ...


4

The width returned by Rasterize is not always correct, as you found out, and since you aren't going to Rasterize before building your tree then the size of the raster graphics is irrelevant in this case. This is the best way to get the size of the text cell (thanks to Sjoerd C. de Vries), {w1, h1} = ImageDimensions@ImageCrop@Graphics@ExpBox[Fooooo/2]; {w2, ...


4

Your creation of xy[t_]=... is not a good idea in the sense that xy[anything] produces a static table. Try xyPointList = Module[{t}, Table[If[t < 1, {x[0] = 0, y[0] = RandomReal[{-1, 1}]}, {x[t] = x[t - 1] + RandomReal[{0, 1}], y[t] = y[t - 1] + RandomReal[{-1, 1}]}], {t, 0, 10}]] (* {{0, 0.0251049}, {0.211352, 0.0367706}, ...


4

I am precomputing an Array of random numbers from 0 to 1 for x and -1 to 1 for y that will be the displacements. To that I Prepend {0,0} to define a fixed initial position. Then I Accumulate that list for a successive accumulated totals of elements. Then use Interpolation so the function is also defined at any arbitrary position between points. xy = ...


3

To make it automatic without rasterizing use ImageSize->Full: Graphics[Text@Framed@Style[FooBarFooBarFooBarFooBarFooBarFooBar, 18], ImageSize -> Full] or Graphics[Text@Framed@Style[FooBarFooBarFooBarFooBarFooBarFooBar, 18], ImageSize -> {Full, Automatic}]


3

It looks like the front end method to determine the width does not account for the full size of the frame. To fix/work around you can add margins to the text and rasterize before passing it to Graphics: Graphics[ Rasterize[ Text[Framed[Style[FooBarFooBarFooBarFooBarFooBarFooBar, 18], ImageMargins -> 50]], RasterSize -> 800]] EDIT As ...


1

Indeed, there is a bug, as I noted in a related answer, and a bug report has been submitted by @Peeter Joot in 2013. As a temporary fix for the issue (hoping that the bug will get resolved in the near future after more than two years), you could use the following modification of the plotting function in the question: volumetricPlot[latticeType_] := Module[ ...


1

If there is a need to preserve initial structure of the code, some condition may be an option: Manipulate[ dom = {-10, 10}; If[Not[NumericQ[f]] || Not[Between[f, dom]], f = 0]; Plot[a Sin[2 Pi f t/12], {t, 0, 12}, PlotRange -> {{0, 12}, {-1, 1}}, AspectRatio -> 0.5, Frame -> True, Axes -> True, ImageSize -> 800], Row[{ ...


1

You can avoid trouble by choosing reasonable values for the range and increment of your controls. The following choices work well. Manipulate[ Plot[a Sin[2 Pi f t/12], {t, 0, 12}, PlotRange -> {{0, 12}, {-1, 1}}, AspectRatio -> 0.5, Frame -> True, ImageSize -> 700], Row[{ Control[{{f, 1, "frequency"}, 0, 10, 0.01, ...


1

Why not just use EdgeForm and FaceForm directly instead? points = {{0, 0}, {4, 0}, {3, 3}}; triangle = Triangle[points]; circle = Insphere[points]; Graphics[{ circle, { FaceForm[{Yellow,Opacity[0]}], EdgeForm[{Thick,Black}], triangle } }]


1

I think MarcoB suggestion, made in a comment, should be put on record. x = Sin[(π t)/3] (Exp[Cos[(π t)/2]] - Sin[π t] + Sin[(π t)/(3 12)]^5); y = Cos[(π t)/3] (Exp[Sin[(π t)/2]] - Cos[π t] + Sin[(π t)/(3 12)]^5); With[{a = 0, b = 30 π}, ListPlot[Table[{x, y}, {t, a, b, .02}]]]


1

The simplest way I thick is to use Dynamic["your function"] instated of 1 in your controller. Control[{{A, 0.1, "Amplitude"}, 0, Dynamic["your function"], 0.01, Appearance -> {"Labeled", "Closed"}}] I think this will give you want you want, (assuming the function of the end is f+1): Manipulate[ Plot[A Sin[2 Pi f t/12], {t, 0, 12}, PlotRange -> ...



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