Hot answers tagged

12

Based on the comment by Szabolcs I came up with a solution. Here it is xyText[str_, scaling_: 1, offset_: {0, 0, 0}] := Module[{ mesh = DiscretizeGraphics[ Text[Style[str, FontFamily -> "Monospac821 BT"]], _Text, MaxCellMeasure -> 1] }, MeshPrimitives[mesh, 2] /. {x_?NumberQ, y_?NumberQ} :> (scaling {x, y, 0} + offset) ...


10

In at least this case, Method -> {"RelieveDPZFighting" -> True}, which is useful when you have nearly coplanar polygons in your plot, removes the observed jitter and streakiness. I picked this up from Brett. {ListPlot3D[data, ColorFunction -> "SolarColors", Filling -> Bottom, FillingStyle -> {Opacity[1]}, InterpolationOrder -> ...


7

It took quite a while, but I've finally come up with a way to generate discretized tubes. This again is based on work in this previous answer (from the thread mentioned earlier by Michael). In the interest of keeping things short, I will not be repeating the definitions of orthogonalDirections[], extend[], and crossSection[] from that answer. Here, then, is ...


6

Update AxesEdge does what you want. Graphics3D[Cylinder[], Axes -> True, AxesEdge -> {{-1, 1}, {1, -1}, {1, -1}}] The following shows more specifically how each of the edges are selected: p1 = Graphics3D[Cylinder[], Axes -> True, AxesEdge -> {{1, 1}, None, None}, ViewPoint -> Left, PlotLabel -> "x {1,1}"]; p2 = Graphics3D[...


6

The answer can be found here: Change The Lighting Of Plots in the official How Tos. For "Standard"/Automatic: Graphics3D[Sphere[], Lighting -> {{"Ambient", RGBColor[0.4, 0.2, 0.2]}, {"Directional", RGBColor[0, 0.18, 0.5], ImageScaled[{2, 0, 2}]}, {"Directional", RGBColor[0.18, 0.5, 0.18], ...


5

If you look at the InputForm of ChromaticityPlot3D[{"WideGamutRGB", "sRGB"}] you'll find several spots where it says Lighting -> "Neutral" So if you want to change that, you'll have to modify the output of ChromaticityPlot3D using a replacement rule. Here is an extreme example, one that totally ruins the plot but shows how to change the lighting, ...


4

Introduction Previously, I have done some similar work. Here is how I would approach it. Please bear in mind, there might be a better solution out there and I would give it some time for the community to respond Example RegionPlot3D[ RegionDifference[cub, cyl2], PlotPoints -> 100, PlotStyle -> Directive[Red] ] Note: cub and cyl12 are as in ...


4

Actually I think what you need is ColorFunction and ColorFunctionScaling. In ColorFunction you can set the color in different regions according to the points' {x,y,z} coordination. And I think what you need is just setting some part in a color (in my code, Bed) and the other in another color(in my code, Blue). Then, simply create a function discribing this ...


4

With version 10.4.1 I get the plot rasterized (but not the legend) with your code. As a workaround you can use the Jens' trick: Export["myFig2.eps", Graphics[Inset[pl, Automatic, Automatic, Scaled[1]]]]; Here is how the exported EPS file looks when opened by Adobe Acrobat 11 (I have selected a number on the frame in order to show that it is a selectable ...


4

Update From the comments what I believe you want is the rotating window not to resize as you rotate. This happens because the default RotatingAction is "Fit". You need it to be "Clip". Labeled[ Plot3D[(y^2 - x^2 - 1/6 x^3), {x, -8, 5}, {y, -6, 6}, MeshFunctions -> {#3 &}, Mesh -> 60, PlotPoints -> 50, RotationAction -> "Clip"], ...


3

I'm surprised that the first example works. There is an issue with converting Tube objects to MeshRegion objects, and in fact DiscretizeGraphics fails on curve1 and curve2 alike. You can use the trick from this page, to convert to a MeshRegion before export as STL. << "http://pastebin.com/raw/FQXgqhn3" (*Import the TubeMesh function from pastebin*) ...


3

You can extract the data from the plot and look for the maximum z value: p = Plot3D[new[α, χ, 0.9] - old[0.9], {α, 0, 2 π}, {χ, 0, π}, MaxRecursion -> 0, AxesLabel -> Automatic, PlotPoints -> 20] Cases[p, GraphicsComplex[pts_, __] :> MaximalBy[pts, Last], -1] (* {{{2.31486, 2.14951, 0.145981}}} *) However be aware that the result depends ...


3

One could override the setting for each polygon group (or GraphicsGroup[]): cp /. p_Polygon :> {Lighting -> {{"Ambient", White}}, p} cp /. gg_GraphicsGroup :> {Lighting -> {{"Ambient", White}}, gg} Update: Addendum. While Lighting shows up in Options@ChromaticityPlot3D, it is not listed among the options in the docs for ChromaticityPlot3D....


3

A recommendation to the question poser: Pose your question in the absolute simplest terms, limiting to the minimal example that addresses your point. There is no need here, for instance, for the community to have to download a complicated data set in order to see how to color one part of a plot differently from others. Why do we need to incorporate text ...


3

In v10.1 under Windows x64 I experience no "z-fighting" in this example when using the "BSPTree" rendering method. This method may be individually using BaseStyle data = {{1, 1, 1, 1}, {1, 0, 3, 1}, {2, 0, 0, 1}}; plot = ListPlot3D[data, Mesh -> None, InterpolationOrder -> 0, Filling -> Bottom, FillingStyle -> {Opacity[1]}, ColorFunction -&...


3

Since the mesh for the picture in the OP was not provided, I'll use this example from an FEM tutorial, but with altered boundary conditions: bcs = InitializeBoundaryConditions[vd, sd, {{DirichletCondition[u[t, x, y, z] == 2, ElementMarker == 1], DirichletCondition[u[t, x, y, z] == 0, ElementMarker == 2]}}] Using the corresponding interpolating ...


3

Example Description This can be achieved using PlotRange -> {{xmin,xmax},{ymin,ymax},{zmin,zmax}}, you can use Automatic as an argument to let Mathematica decide what is min or max. For example, PlotRange -> {Automatic, Automatic , {1,Automatic}} Code m = 1; q = 5/2; K = Sqrt[4 m/(3 - q)]; \[Xi] = (q - 1)^2/4 K^2; A = Pi/Sqrt[\[Xi]]; Plot3D[ 1/A (...


3

I can think of no solution to the color streaking problem other than perturbing the size of one the two coinciding cones. I choose to perturb projcone2. origin = Point[{0, 0, 0}]; cone1 = Cone[{{0, 0, 1}, {0, 0, 0}}]; transform = {{0.3, 0, 0.15}, {0, 0.35, 0}, {0.1, 0, 0.5}}; cone2 = GeometricTransformation[cone1, transform]; projcone2 = Scale[cone2, {2.99, ...


2

The only way I could find to add the ellipse you are asking for to your graphic was to compute a set of points along the ellipse and make line segments from them. Here is how I did it. The following generates the graphic you show int the question. origin = Point[{0, 0, 0}]; cone1 = Cone[{{0, 0, 1}, {0, 0, 0}}]; transform = {{0.3, 0, 0.15}, {0, 0.35, 0}, {0....


2

The problem is plot quality, not the code. The answer is MaxRecursion ParametricPlot3D[{I01[x, y], I11[x, y], I02[x, y]}, {x, 0, 8 \[Pi]}, {y, 0, 8 \[Pi]}, MaxRecursion -> 5]


2

Or just keep the original definitions of test1 and test2 and use the PlotRange option: Show[test1, test2, PlotRange -> Automatic] Why is Automatic not the default option? I'm not sure. Why does the default PlotRange result in an insane range for the 3rd coordinate? Charting`get3DPlotRange@Show[test1, test2] (* {{-1.95773, 1.06036}, {-0.0206875, ...


2

Updated using mem: as suggested by Simon Woods. Perhaps using Plot3D at a couple of intervals of tau will be enlightening. The results seems plausible based on the fact that old is a 1D function. ClearAll["Global`*"] G = 0.01; β = 1; ωc = 50; j = 1; ϕ = 0; θ = π/2; η = Exp[I ϕ] Tan[θ/2]; Clear[ψ] ψ[α_, χ_] := Exp[I α]*Tan[χ/2]; integralgamma[ω_, τ_] := ...


2

I was unable to locate the function R[t] so I made one up. I also changed the BoxRatios to make it a bit easier to see. R[t_] := 4 + Cos[\[Pi] t] r[t_, ϕ0_] = {R[t] Cos[ϕ0], R[t] Sin[ϕ0], t} ParametricPlot3D[r[t, ϕ0], {ϕ0, 0, 2 π}, {t, 0, 2}, MeshFunctions -> {#4 &}, Axes -> None, Boxed -> False, BoxRatios -> {1, 1, 1}, ImageSize -&...


1

One way of plotting 4d data is with: DensityPlot3D[ Re[new[α, χ, τ] - old[τ]], {χ, 0, π}, {α, 0, 2 π}, {τ, 0.1, 1}, PlotPoints -> 11] To do this with manipulate, it is wise to do all the calculations first, and storing the values in a dataset. data = Table[ Table[{α, χ, Re[new[α, χ, τ] - old[τ]]}, {χ, π/ 16, π, π/8}, {α, 0, 2 π, ...


1

Try this: test1 = Graphics3D[{ Arrow[{{1/10, 3/Sqrt[10], -(Sqrt[(5/2)]/3)}, {-3 Sqrt[2/5], 1, 0}}]}]; test2 = ParametricPlot3D[{x, Sqrt[1 - x], 0.1/x}, {x, 0, 1}, BoxRatios -> {1, 1, 1}, PlotRange -> {{-2, 1}, {-1, 1}, {-0.5, 1}}, AxesLabel -> {x, u, t}]; Show[{test2, test1}] yielding this:


1

The options given to the final Graphics3D object are generally taken to be those specified in the first object passed to Show. In This case, you didn't specify an explicit PlotRange argument in test1, and that specified in test2 is not used, so that Mathematica chooses it automatically. You will notice that just changing the order of the arguments of Show, ...



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