Tag Info

Hot answers tagged

9

This now has been discussed in Wolfram blog post by Michael Trott: Making Formulas… for Everything—From Pi to the Pink Panther to Sir Isaac Newton Here is one of the example apps from blog - go read it in full - fun! Don't miss the link to download the notebook with complete code and apps at the end of the blog.


7

At OP's behest: The easiest approach to see the mesh lines is to remove the EdgeForm[] instruction that causes them not to appear. For instance, DeleteCases[Import["ExampleData/wrench.obj.gz"], _EdgeForm, ∞] As SEngstrom suggests, you can also use a replacement rule. If, for instance, you want a thick gray mesh, here's what you can do: ...


6

Here's a quick 5 minute reproduction of the diagram (I've left the labeling of individual points out): With[{ε = 0.05, L = 1, thick = AbsoluteThickness[1]}, Graphics[{ thick, Circle[{0, 0}, ε, {π/2, 3 π/2}], Arrowheads[{{0.05, 0.99}}], Arrow[{{0, -ε}, {L, -ε}, {L, -L}, {-L, -L}, {-L, L}, {L, L}, {L, ε}, {0, ε}}], ...


6

Graphics[{Circle[{0, 0}, 1, Pi/2 {1, 3}], Arrow[{{10, 1}, {0, 1}}], Line[{{0, 1}, {10, 1}, {10, 10}, {-10, 10}, {-10, -10}, {10, -10}, {10, -1}, {0, -1}}]}, Axes -> True, Ticks -> None]


6

What about this: Import["ExampleData/wrench.obj.gz", "PolygonObjects"] // Graphics3D You can use the FaceForm[None] trick as shown by @J.M. here just as well if you only want the wireframe looks.


6

You must add the option PlotRangeClipping -> True Show[...,PlotRangeClipping -> True] Explanation of your results : Show[gr1,gr2 ...] take the options of the first graphic in the list, gr1 here. Concerning the scatterplot, Graphics[] has by default PlotRangeClipping -> False Concerning the line, Plot[] has by default PlotRangeClipping ...


5

The comment is right, but here is a thought. If you'd like a cube you should use Cuboid and leave the 3D box for the role it plays - to put things in a better 3D perspective (if needed). Then you precisely control all coordinates. You could try something like Graphics3D[{ {Red, Opacity[.7], Polygon[{{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}]}, {Opacity[.2], ...


3

As noted by xslittlegrass you can get coincident vertices by instructing Graphics3D not to use padding of the plot range, by using PlotRangePadding -> 0. AspectRatio controls the two dimensional image aspect ratio rather the proportions of the three dimensional rendering which is what I expect you intended; for that use BoxRatios. Specifying Boxed -> ...


3

You could use RotationAction -> "Clip". You will find that this also drastically improves interactive rotation performance on complex graphics. It often produces a lot of extra white space around the plot, but that can be controlled with ViewAngle if necessary. ViewAngle by itself will also fix the viewpoint which has the same effect, so you may use ...


3

so following my comment you can do this.. dz = .01; i3d = Image3D[Table[ Image[Rasterize[ Graphics3D[Cylinder[{{0, 0, 0}, {1, 2, 0}}, 1], Boxed -> False, ViewPoint -> {0, 0, Infinity}, PlotRange -> {All, All, {z - dz, z + dz}}]] ] , {z, -1, 1, dz}]]; ImageData[i3d][[100, 100, 100]] The problem as QuadraticU noted is your 3D "objects" ...


2

Another way, copying once more from @J.M.'s answer here: How can I fill under a function in a plot just to right of a specified vertical line? Using @b.gatessucks definition of f: f[r_, k_] = (HarmonicNumber[k] - HarmonicNumber[k - r]) (HarmonicNumber[k] - HarmonicNumber[-1 + r]) we can do: With[{ff = f[r, 10]}, ...


2

One way : f[r_, k_] = (HarmonicNumber[k] - HarmonicNumber[k - r]) (HarmonicNumber[k] - HarmonicNumber[-1 + r]) sol1 = r /. FindRoot[f[r, 10] == 0.4, {r, 2}]; sol2 = r /. FindRoot[f[r, 10] == 0.4, {r, 9}]; m = FindMaximum[f[r, 10], {r, sol1, sol2}][[1]]; Show[Plot[f[r, 10], {r, 0, 11}], Plot[f[r, 10], {r, 0, sol1}, Filling -> Bottom], ...


1

You could draw an invisible second function (a block) and have the filling occur between the two: f[r_, k_] = (HarmonicNumber[k]-HarmonicNumber[k-r])(HarmonicNumber[k]-HarmonicNumber[-1 + r]); max = NMaxValue[{f[r, 10], 0 < r < 11}, r] min = NMinValue[{f[r, 10], 0 <= r <= 11}, r] Plot[ { f[r, 10], Rescale[ Boole[f[r, 10] > 0.4], ...


1

For version 7: Warning: for simplicity r is not localized in either method; Formal Symbols advised in practice. hf[K_] := With[{H = HarmonicNumber}, (H[K] - H[K - r]) (H[K] - H[r - 1])] Plot[ {If[hf[10] < 0.4, hf[10]], If[hf[10] >= 0.4, hf[10]]}, {r, 0, 11}, Filling -> {1 -> Bottom}, PlotStyle -> Black ] Or: Plot[ {If[hf[10] < ...


1

Maybe you can consider a solution like this instead? newPoint[{col_, Point[pt_]}] := Block[{nc, tr}, {nc, tr} = (* use RandomChoice to pick an affine transformation and its corresponding color *) RandomChoice[{{Red, AffineTransform[{{{0.5, 0}, {0, 0.5}}, {0, 0}}]}, {Green, AffineTransform[{{{0.5, 0}, {0, 0.5}}, {1/2, 0}}]}, ...


1

Using the ImageSize and ImageResolution options can be a bit tricky sometimes, but this will usually work: g = Plot[Sin[x], {x, 0, 10}] cm = 72/2.54 (* centimetre *) Export["figure.tiff", Show[g, ImageSize -> 10 cm], ImageResolution -> 300] This will export an image 10 cm wide with 300 dpi resolution. The important point was to use ImageSize ...


1

Here is a trivial text recognizer based on the input samples you've given, it might act as a template for a more customized solution for you. It may be that you want a more generic solution, in which case you can increase the number of training templates, or abstract a generalized model of the characters that you are interested in. (* Import example ...



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