Tag Info

Hot answers tagged

14

You can use Show to combine graphics of the same type: g1 = Plot3D[x^2 - y^2, {x, -3, 3}, {y, -3, 3}, RegionFunction -> Function[{x, y, z}, 2 < x^2 + y^2 < 9]]; g2 = SphericalPlot3D[ 1 + Sin[5 θ] Sin[5 φ]/5, {θ, 0, π}, {φ, 0, 2 π}, Mesh -> None, RegionFunction -> (#6 > 0.95 &), PlotStyle -> FaceForm[Orange, Yellow]]; ...


14

You can always hide away the coordinate transformations inside a function that calls RegionPlot3D. Here's a quick & dirty sphericalRegionPlot3D: sphericalRegionPlot3D[ ineq_, {r_, rmin_: 0, rmax_: 1}, {th_, thmin_: 0, thmax_}, {ph_, phmin_, phmax_}, opts___] := RegionPlot3D[With[{ r = Sqrt[x^2 + y^2 + z^2], th = ArcCos[z/Sqrt[x^2 + y^2 + ...


13

While not positive, I believe the answer is that RegionPlot does not support spherical (or other non-Cartesian) coordinates natively. If correct, I guess the question becomes "What's the easiest way to plot a region defined in terms of spherical coordinates, without resorting to converting the equations by hand?" V9 has commands to ease this process. ...


13

Βαγγέλη, you can use an appropriate RegionFunction: V = 1/2*(x^2 + y^2 + z^2) + (x^2*y^2 + x^2*z^2 + y^2*z^2 - x^2*y^2*z^2); E0 = 7; S0 = ContourPlot3D[V == E0, {x, -4, 4}, {y, -4, 4}, {z, -4, 4}, PlotPoints -> 70, PerformanceGoal -> "Speed", Mesh -> None, ContourStyle -> Directive[Green, Opacity[0.3], Specularity[White, 30]], ...


10

Perhaps something like this? p = Plot[x^3/9, {x, -3, 3}, PlotStyle -> Thickness[0.01], Filling -> Axis, AspectRatio -> 1, ImageSize -> 500, BaseStyle -> {FontFamily -> "Calibri", 30}, AxesStyle -> Thick]; With[{k = 3}, SphericalPlot3D[1, {theta, 0, Pi}, {phi, 0, 2 Pi}, Mesh -> None, Boxed -> False, Axes -> False, ...


10

It sounds like you might like to use a stereographic projection. xy[ϕ_, λ_] := 2 Tan[(π - ϕ)/2] {Cos[λ], Sin[λ]}; Here is a cubic with a free parameter (for fun): cubic[{x_, y_}, b_] := y^3 - b x y + 4 x^3; For the sphere, use SphericalPlot3D of course. Although you could resort to ParametricPlot3D for the cubic curve, it's automatic and much simpler ...


8

Use the inequality to sow all integer coordinates that are inside the boundary of the region when iterating through all integer pairs of the full range: pts = First@Last@Reap@Do[If[x >= 4 y && x <= 4 y + 3, Sow@{x, y}], {x, 0, 63}, {y, 0, 15}] RegionPlot[x >= 4 y && x <= 4 y + 3, {x, 0, 63}, {y, 0, 15}, Epilog -> {Red, ...


6

One option would be to restrict the function from funky regions with a Condition liks this f[x_, y_] /; Abs[x - y] > 5 := (Sin[x] - Sin[y])/(x - y); Plot3D[f[x, y], {x, -10, 10}, {y, -10, 10}] Out: One can easily see that Plot3D will also sample points in the region which is "forbidden", the points are just not drawn due to the RegionFunction. ...


6

All you're missing is the option for BoundaryStyle RegionPlot[1 <= x^2 + y^2 < 9, {x, -3.5, 3.5}, {y, -3.5, 3.5}, Frame -> False, AxesOrigin -> {0, 0}, Axes -> True, BoundaryStyle -> {Dotted, Thickness[0.005]}] If you want the unit circle filled, you can RegionPlot that separately: Show[RegionPlot[1 <= x^2 + y^2 < 9, {x, ...


6

u = {x, x^3, 0}; v = {0, 0, z2}; l = (u - v) t + v; w = l /. Solve[xs xs + ys ys + (zs - 1)^2 == 1 /. Thread[{xs, ys, zs} -> l], t][[2]]; Manipulate[Show[ ParametricPlot3D[{Cos[u] Sin[v], Sin[u] Sin[v], 1 - Cos[v]}, {v, ArcCos[1 - z1], 0}, {u, 0, 2 Pi}, PlotStyle -> {Opacity[.3], FaceForm[Red, Yellow]}, Mesh -> False, ...


6

Another way to generate all the points is by using Reduce: points = {x, y} /. List@ToRules@ Reduce[x >= 4 y && x <= 4 y + 3 && 0 < x < 63 && 0 < y < 15, {x, y}, Integers] If you give bounds (and thus constrain the possible solutions to a finite set), Reduce will typically list all solutions. Then just plot ...


5

Solution using Show needs to rearrange the order of ranges in ContourPlot3D, e.g. : Show[RegionPlot3D[(s - 3 q*s + q > 0 && p == 0) || (s - 3 q*s + q <= 0 && p == 1), {q, 0, 1}, {s, 0, 1}, {p, 0, 1}, AxesLabel -> Automatic], ContourPlot3D[s - 3 q*s + q == 0, {q, 0, 1}, {s, 0, 1}, {p, 0, ...


5

Try to define your matrix as a function of $(x,q,r,t)$ variables S[x_, q_, r_, t_] := {{1/r^2, 1, 1, t Sqrt[x]}, {1, 1/t^2, 1, Sqrt[x]/t}, {1, 1, 1, Sqrt[q]}, {t Sqrt[x], Sqrt[x]/t, Sqrt[q], 1}}; Then Manipulate does what you want Manipulate[ RegionPlot[ PositiveDefiniteMatrixQ@S[x, q, r, t], {x, 0, 1}, {q, 0, 1}], {{r, 1/2}, 0, 1}, {{t, 1/2}, 0, ...


5

By looking at the hyperbolic behavior of the branches, you may try a simple RegionFunction[]: ContourPlot3D[V == E0, {x, -4, 4}, {y, -4, 4}, {z, -4, 4}, PlotPoints -> 70, PerformanceGoal -> "Speed", Mesh -> None, ContourStyle -> Directive[Green, Opacity[0.3], Specularity[White, 30]], ImageSize -> 550, RegionFunction -> (Abs[#1 #2 ...


4

One easy way will be to use Opacity! Plot[{Sin[x], Cos[x]}, {x, -\[Pi], +\[Pi]}, Filling -> {1 -> {Axis, Directive[Opacity[.7], Blue]}, 2 -> {Axis, Directive[Opacity[.7], Red]}}] Update: Here comes a better solution for your problem. The function is pretty much self explanatory as far as the argument names are concerned. Given a list of ...


3

The reason the B appears incorrectly is not because of the shape of G, but rather because the horizontal length of G is less than the vertical length of B, resulting in B being decapitated. Here's how the letters look at present when one is laid on top of the other at 90º: Notice that in the actual GEB logo, they use a squarish font, which solves this ...


2

Another, using smart and fast functions like Array and Tuples, thus a bit more recommended way : RegionPlot[ x >= 4 y && x <= 4 y + 3, {x, 0, 63}, {y, 0, 15}, Epilog -> { Red, PointSize[0.005], Point[ Join @@ Tuples /@ Array[ {Range[4 #, 4 # + 3], {#}} &, {16}, 0]]}, AspectRatio -> 15/63 ]


2

Alternatively you can generate just the points you want and then plot them : data = DeleteCases[Flatten[Outer[Boole[4 #2 <= #1 <= 4 #2 + 3] {#1, #2} &, Range[0, 63], Range[0, 15]], 1], {0, 0}]; Show[RegionPlot[x >= 4 y && x <= 4 y + 3, {x, 0, 63}, {y, 0, 15}], ListPlot[data]]


2

A simple approach would be to plot a third function which defines the overlap region. overlap[f_List] := Piecewise[{{Sign[First@f] Min[Abs@f], Equal @@ Sign[f]}}, I] Plot[{Sin[x], Cos[x], overlap[{Sin[x], Cos[x]}]}, {x, -π, π}, Filling -> {1 -> {0, Blue}, 2 -> {0, Red}, 3 -> {0, Thread[Red + Blue, RGBColor]}}]


2

More generalized version: newRegionPlot3D[ expr_, {u_, umin_, umax_}, {v_, vmin_, vmax_}, {w_, wmin_, wmax_}, tr_, opts___] := Module[{x, y, z, newExpr, xyz}, newExpr = TransformedField[tr -> "Cartesian", expr, {u, v, w} -> {x, y, z}]; xyz = CoordinateTransform[tr -> "Cartesian", {u, v, w}]; {xmax, ymax, zmax} = NMaxValue[{#, ...


2

I can get the integral by using the first quadrant (for positivity), placing an assumption on n, and recasting without Boole (I don't know why that was needed). in = 4 Integrate[(x^(2 n) + y^(2 n)), {x, 0, 1}, {y, 0, (1 - x^(2 n))^(1/(2*n))}, Assumptions -> n >= 1] (* Out[112]= (2^(2 - 1/n) Sqrt[\[Pi]] Gamma[1 + 1/(2 n)])/((1 + n) Gamma[(1 + ...


1

By manual inspection I got a closed formula for your integral: s[n_] := 2/(n + 1) Gamma[1/(2 n)] Gamma[(2 n + 1)/(2 n)]/Gamma[1/n] f[n_] := Integrate[(x^(2 n) + y^(2 n)) Boole[x^(2 n) + y^(2 n) < 1], {x, -1, 1}, {y, -1, 1}] For example s[16] == f[16] (* True *) Plot[s[x], {x, 1, 100}] So Limit[s[n], n -> Infinity] (* 0 *)


1

Without knowing exactly how you want to define your projected function in terms of the spherical coordinates, I'll just make up a definition and use the following, based on this answer by Vitaliy Kaurov: f[θ_, ϕ_] := SphericalHarmonicY[2, 1, θ, ϕ] With[{thetaMin = .8}, SphericalPlot3D[1, {θ, thetaMin, Pi}, {ϕ, 0, 2 Pi}, ColorFunction -> ...


1

I am not sure I understand your question. What is a "3D set" and a "3D surface"? If you need to combine two 3D graphics, use Show[graphic1, graphic2]. Your surface can be plotted using Plot3D as well, but the quality of the discontinuous part will not be excellent: Plot3D[Boole[s - 3 q*s + q < 0], {q, 0, 1}, {s, 0, 1}, ExclusionsStyle -> ...


1

Some square font from internet: {Bach, Escher, Gödel} = ClusteringComponents /@ RegionPlot3D[ Gödel[[Round[i], Round[j]]] > 1 && Escher[[Round[i], Round[k]]] > 1 && Bach[[Round[j], Round[k]]] > 1, {i, 1, 120}, {j, 1, 120}, {k, 1, 120}, Axes -> False, Boxed -> False, PlotPoints -> 100, Mesh -> False, Lighting ...



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