Tag Info

Hot answers tagged

46

Yes we can. The following DashedGraphics3D[ ] function is designed to convert ordinary Graphics3D object to the "line-drawing" style raster image. Clear[DashedGraphics3D] DashedGraphics3D::optx = "Invalid options for Graphics3D are omitted: `1`."; Off[OptionValue::nodef]; Options[DashedGraphics3D] = {ViewAngle -> 0.4, ViewPoint ...


42

Consider this: ParametricPlot3D[ RotationTransform[a, {0, 1, 0}][{0, 0, Sin[3 a] + 5/4}], {a, 0, 2 Pi}, Evaluated -> True] Now rotate this around a circle, while rotating it at the same time around its' origin: ParametricPlot3D[ RotationTransform[b, {0, 0, 1}][{6, 0, 0} + RotationTransform[a + 3 b, {0, 1, 0}][{0, 0, Sin[3 a] + 5/4}]], ...


35

Basic method There appears to be a mechanism for doing just that, though I have yet to map its capabilities. As a basic example for the time being: Themes`AddThemeRules["wizard", DefaultPlotStyle -> Thread@Directive[{Purple, Orange, Hue[0.6]}, Thick], LabelStyle -> 18, AxesStyle -> White, TicksStyle -> LightGray, Background -> ...


28

The triangle plot markers It is natural to expect that the triangle marker is placed in such a way that its center of mass (center of circumcircle) coincides with the point it marks. That's how it is implemented in all major scientific plotting software, for example Origin: Some time ago I published my own implementation of triangle-based plot markers. ...


25

Yet another method: Let us calculate values of function on appropriate rectangular grids, which we will convert to textures (1 pixel = 1 value). Interpolation between pixels is built-in. f = 2 #1^2 + 2 #2^2 + #3^2 + #1 #2 &; PolyhedronData["Cube"] // N // Normal // toTriangles // texturize[f, 50, Hue, Lighting -> "Neutral", Axes -> True] ...


22

i = Import@"http://i.stack.imgur.com/8I3B1.jpg"; f[{{tmin_, tmax_}, {rmin_, rmax_}}, ___] := Module[{l = Join[{{0, 0}}, Table[{Cos@t, Sin@t}, {t, tmin, tmax, (tmax-tmin)/100}]]}, {Texture[i], EdgeForm[], Polygon[l, VertexTextureCoordinates -> 1/2 Transpose[Transpose[l] + {1, 1}]]}] Framed@PieChart[{1, 2, 3, 4, 5, 6}, ChartElementFunction -> f] ...


22

One can also use MeshFunctions: Clear[f]; f = {x, y, z} \[Function] x + Sin[5 z] + y^2; cube = PolyhedronData["Cube", "RegionFunction"]; mesh = 15; RegionPlot3D[cube[x/2, y/2, z/2], {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, MeshFunctions -> {f}, Mesh -> mesh, MeshShading -> ColorData["Rainbow"] /@ Range[0, 1, 1/(mesh + 1)], PlotPoints -> 50, ...


22

A basic approach You can start with a regular density plot, restricted to the domain of x and y using RegionFunction. Then you can transform the plot to an equilateral triangle. f[p_, q_, r_] := r Sin[10 p]^2 + (1 - r) r Cos[20 q]^2; dp = DensityPlot[f[x, y, 1 - x - y], {x, 0, 1}, {y, 0, 1}, RegionFunction -> (#1 <= 1 - #2 &), ColorFunction ...


21

Here is another approach. It could be improved (I am sure) to properly determined the principle axes and translation (if I get time I will aim to update): lin = {#1^2, #1, #2, 2 #1 #2, #2^2} & @@@ points; lm = LinearModelFit[lin, {1, a, b, c, d}, {a, b, c, d}] Exploring model: lm["ParameterTable"] Determining quadric formula: pa = ...


20

Something like this perhaps. Thanks to halmir for pointing out that multiple highlighted elements might be useful. pieHighlight[chart_, n_] := chart /. DynamicModule[init_, body__] :> (ReplacePart[Hold[init], Thread @ {1, n, 2} -> True] /. Hold[x_] :> DynamicModule[x, body]) e.g. PieChart[{1, 2, 3}] ~pieHighlight~ 2 PieChart[{1, 2, ...


20

This is how I would do this. Define frequencies and sampling rate precisely. Then use Periodogram because it takes SampleRate as an option and rescales frequency axis automatically. Read up Docs on Periodogram - see examples there. data = Table[{t, Sin[2 Pi 697 t] + Sin[2 Pi 1209 t]}, {t, 0., 0.1, 1/8000.}]; ListLinePlot[data, AspectRatio -> 1/4, ...


20

Taking the cube root on both sides fixes the problem, and then you don't need lots of PlotPoints any more. ContourPlot3D[(x^2 + 9/4 y^2 + z^2 - 1) == CubeRoot[x^2 z^3 + 9/80 y^2 z^3], {x, -6/5, 6/5}, {y, -6/5, 6/5}, {z, -6/5, 3/2}, Mesh -> None, Boxed -> False, AxesLabel -> {"x", "y", "z"}, Axes -> False, ContourStyle -> Directive[Red, ...


18

In an presentation by Markus van Almsick, he gives an solution to visualize atomic orbitals using Image3D. Radius wave function (hydrogen): R[n_Integer?Positive, l_Integer?NonNegative, r_] := Block[{ρ = (2 r)/n}, Sqrt[(2/n)^3 (n - l - 1)!/(2 n (n + l)!)] E^(-ρ/2) ρ^l LaguerreL[n - l - 1, 2 l + 1, ρ]] /; l < n full wave function: ψ[n_, l_, m_, ...


17

This is based on Rahul's ideas, but a different implementation: contourRegionPlot3D[region_, {x_, x0_, x1_}, {y_, y0_, y1_}, {z_, z0_, z1_}, opts : OptionsPattern[]] := Module[{reg, preds}, reg = LogicalExpand[region && x0 <= x <= x1 && y0 <= y <= y1 && z0 <= z <= z1]; preds = Union@Cases[reg, _Greater | ...


17

Something to get you started? f[{x_, y_}] := -Cos[x] x^2 - y^2 xy = First[ ContourPlot[f[{x, y}], {x, -1, 1}, {y, -1, 1}]] /. {x_?AtomQ, y_?AtomQ} :> {x, y, 1}; xz = First[ ContourPlot[f[{x, y}], {x, -1, 1}, {y, -1, 1}]] /. {x_?AtomQ, y_?AtomQ} :> {x, -1, y}; yz = First[ ContourPlot[f[{x, y}], {x, -1, 1}, {y, -1, 1}]] /. ...


17

Update: PlotPiecewise now automatically tries to convert a non-Piecewise function into one using PiecewiseExpand. PiecewiseExpand will also do some simplification, such as factoring and reducing a rational function; to avoid that, pass a Piecewise function directly. PlotPiecewise will not alter the formulas in a Piecewise. Note, however, that Mathematica ...


17

body[t_] = Integrate[#[u^2], {u, 0, t}] & /@ {Cos, Sin} ParametricPlot3D[body[t]~Join~{t}, {t, -2 Pi, 2 Pi}, BoxRatios -> 1, SphericalRegion -> True]


16

If you want to roll your own solution to evenly distrubute circles along the path you could use the so called arc length parametrization of the path $p(t)=(t,\cos(t))$. For this particular curve, it will need to be computed numerically. p[t_] := {t, Cos[t]}; $Assumptions = {t > 0}; speed[t_] = Simplify[Norm[p'[t]]]; arcLength[t_?NumericQ] := ...


15

I'm adding this answer to put on record an answer to the second part the question, "what is the parametric equation?". The parametric equation is implicit in Kirma's RotationTransform expression. To extract it, one need simply write something like Clear[a, b] quoit[a_, b_] := Evaluate @ RotationTransform[b, {0, 0, 1}][{6, 0, 0} + ...


15

I have found that my approach with textures has different applications: How to plot contours in the faces of a cube? How to plot ternary density plots? Now I want to use it for the enhancement of the DensityPlot: Options[fastDensityPlot] = Append[Options[DensityPlot], Subpoints -> 30]; SyntaxInformation[fastDensityPlot] = ...


15

The default colours for charts are defined by Charting`CommonDump`rogerStyles. For up to five different colours the values are hard-coded: Charting`CommonDump`rogerStyles[5] (* {RGBColor[0.798413, 0.82472, 0.968322], RGBColor[0.733333, 1., 0.833722], RGBColor[1, 0.986999, 0.742123], RGBColor[1, 0.860624, 0.662562], RGBColor[1, 0.696086, 0.721935]} *) ...


15

This is a solution based on interval operations. Usage and examples First, let's look at how to use the function. The code is at the end. Let's generate some sample data and plot it: data1 = RandomVariate[ExponentialDistribution[1], 200]; data2 = RandomVariate[NormalDistribution[2, 1], 200]; beeswarmPlot[data1] Now let's plot two together: ...


15

In analytic geometry, the ellipse is defined as the set of points (X,Y) of the Cartesian plane that, in non-degenerate cases, satisfy the implicit equation with and where Lets fit points with second-order curve (which include ellipse). elipse = a11*x^2 + a22*y^2 + 2*a12*x*y + 2*a13*x + 2*a23*y + a33; coeff = {a11, a22, a12, a13, a23, a33}; ...


15

To long for a comment, but here's one approach, using information readily available in the docs and on this site: First, make a map that wraps a globe changing the Geoprojection to something a bit more useful. img = With[{Δ = 30}, Row[Table[ GeoGraphics[GeoBackground -> GeoStyling["ReliefMap"], GeoRange -> {{-90, 90}, {λ, λ + Δ}}, ...


14

My pc is rather old so there was not much I could do. Maybe no as pretty as in the link but I'm happy because of the result: r = 35; p = Show[ Plot3D[-Sum[2 Exp[-((x - xo)^2 + (y - yo)^2)], {xo, -24, 8, 4}, {yo, -28, 8, 4}], {x, -r, r - 4}, {y, -r, r - 4}, Evaluated -> True, PlotRange -> All, PlotPoints -> 200, Mesh ...


14

Here is a standard direct way to get the principal exes and other transformation data. Find the mean of the points, subtract it to center them, and take the singular value decomposition. The third and second components thereof give the rotation and scaling data necessary to form a circle on which the first component, viewed as a point set, roughly lies. The ...


14

The colors alone are indexed color scheme #97: ColorData[97, "ColorList"] Update: further digging in reveals these PlotTheme indexed color relationships: {"Default" -> 97, "Earth" -> 98, "Garnet" -> 99, "Opal" -> 100, "Sapphire" -> 101, "Steel" -> 102, "Sunrise" -> 103, "Textbook" -> 104, ...


14

In Version 10 you can use the PlotTheme "OpenMarkersThick": data = Table[{x, x^k}, {k, 1, 4}, {x, 0, 1, 0.1}] ListLinePlot[data, PlotTheme -> {"OpenMarkersThick", "LargeLabels"}, PlotLegends -> {x, x^2, x^3, x^4}]


14

RegionFunction is the option you are looking for. ContourPlot[ Evaluate[Sum[Sin[RandomReal[5, 2].{x, y}], {5}]], {x, -3, 3}, {y, -3, 3}, BoundaryStyle -> {Thick, Black}, RegionFunction -> Function[{x, y, z}, x^2 + y^2 < 9] ]


14

Here is another approach which is based on converting the plot to PDF format first. It makes the tick marks accessible as regular Graphics objects. Specifically, they (and the frame) show up as open JoinedCurve that can be identified by pattern matching. That leads to the following: p = Plot[{Sin[x], Cos[x]}, {x, 0, 3 Pi}, Frame -> True, FrameStyle ...



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