Plotting – Polar Contour Plot in Mathematica?

You can use TransformedField to get a function that can be used as the first argument of ContourPlot:

 f = (r^2 - a^3/r) Sin(t)^2;
 tf = TransformedField( "Polar" -> "Cartesian", f, {r, t} -> {x, y})

TeXForm @ tf

$ frac {y ^ 2 left (x ^ 2 sqrt {x ^ 2 + y ^ 2} + y ^ 2 sqrt {x ^ 2 + y ^ 2} -1 right)} { left (x ^ 2 + y ^ 2 right) ^ {3/2}} $

cValues = {0.00001, 0.01, 0.05, 0.1, 0.3, 0.6, 1.0, 1.5, 2.0, 2.5, 3.2};
a = 1;

ContourPlot(tf, {x, -3, 3}, {y, -3, 3}, 
  Contours -> cValues, 
  PlotPoints-> 200,
  Axes -> True,
  Frame -> False,
  PlotRange -> All, 
  ContourShading -> None, 
  AspectRatio -> Automatic,
  RegionFunction -> (Norm({#, #2}) <= 3&))

Enter image description here

An alternative approach is the use f With ContourPlot and post-process the output to transform the lines:

cp1 = ContourPlot(f, {r, 0, 3}, {t, -Pi, Pi}, 
       Contours -> cValues, PlotRange -> All, 
       ContourShading -> None,  Axes -> True, 
       Frame -> False, ImageSize -> 300);

cp2 = Show(cp1 /. GraphicsComplex(c_, rest___) :> 
        GraphicsComplex(c /. {a_, b_} :> (a {Cos(b), Sin(b)}), rest), 
    AspectRatio -> Automatic, ImageSize -> 300);

Row({cp, cp2}, Spacer(15))

Enter image description here

Plotting – What is the best way to use errors in mathematica M12?

Since ErrorListPlot was replaced by new features in ListPlot What is the best way for Mathematica 12.0 to handle errors efficiently? So far, I simply formatted my data in a table as

    Data = 
    Table[
            Stuf to calculate values and errors
            {{xValue, yValue, yError}},
            {i, 1, Stop}
         ]

That made it easy to stick to it ErrorListPlot or use in a fit as

NonlinearModel[Data[[1;;,{1, 2}]], Function, Weights->1/Data[[1;;,3]]^2 ]

Now it seems that you need to use Around[yValue, yError]

        Data = 
        Table[
                Stuf to calculate values and errors
                {{xValue, Around[yValue, yError]}},
                {i, 1, Stop}
             ]

Which works fine in ListPlot and I can adapt data with it, as this will give a fitting result, but I can not figure out how to use it Weights With Around and I can not represent the result of the fitting in the usual way. Can anyone recommend an efficient way to format data according to the new updates?

Plotting – Riemann leaves of the logarithm function

I use Michael Trott codes to visualize Riemann leaves of the logarithm:

Import["http://www.mathematicaguidebooks.org/V6/downloads/
RiemannSurfacePlot3D.m"]
rsurf[func_] := 
Grid[{{RiemannSurfacePlot3D[w == func, Re[w], {z, w}, 
ImageSize -> 400, 
Coloring -> Hue[Rescale[ArcTan[1.4 Im[w]], {-Pi/2, Pi/2}]], 
PlotPoints -> {40, 40}, Boxed -> False], 
RiemannSurfacePlot3D[w == func, Im[w], {z, w}, ImageSize -> 400, 
Coloring -> Hue[Rescale[ArcTan[1.4 Re[w]], {-Pi/2, Pi/2}]], 
PlotPoints -> {40, 40}, Boxed -> False]}}];


rsurf /@ {Log[z]}

However, the code generates two images:

Enter image description here

Enter image description here

The first is the correct leaves of the logarithm function. What is the second picture?

Plotting – How are lines in different colors plotted from data in Graphics 3D?

I want to show all these different lines in different colors to better visualize them. But all I get is the black color for everyone.

Graphics3D[Line[data], PlotRange -> {{0.0, 20.0}, {0, 6}, {0, 400}},BoxRatios -> {0.7, 1, 1.5}, Axes -> True, AxesLabel -> {r, logV, Vref},AxesStyle -> Directive[Black, FontSize -> 20],BoxStyle -> Directive[Thick, Black]]

Here is the output I get

Thanks for your help !!

Plotting – Can you dimension the frame in a plot with absolute unit, eg. cm?

Is it possible to set the height and width of a plot in absolute units for? $ rm {cm} $? Ideally, I would like to specifically control the frame size for the plot option Frame->True is employed?

I have seen that you can set the size of the export plot in absolute units, but can not find anything that allows me to explicitly set the size of the frame and plotting area in a notebook.

Plotting – Restrictions as a string for expression in region plots

I am trying to create a function that generates a sequence of constraints that ToExpression will propagate to a region plot, but I think the plot variables will not be passed.

Clear("Global`*")
ClearAll(Subscript)
lb1(ps_, pr_) := (Sqrt(1 - ps) + Sqrt(pr - ps))^2/(1 - pr);
lb2(ps_, pr_) := (Sqrt(1 - ps) - Sqrt(pr - ps))^2/(1 - pr);
An(ps_, pr_, bb_,n_) := ((pr - ps)*(1 + lb2(ps, pr)^n) + 2 bb*(1 - lb2(ps, pr)^n))/(2*(pr - ps)*(lb1(ps, pr)^n -lb2(ps, pr)^n));

xp(ps_, pr_, bb_) := 1/2 - bb/(pr - ps);
xn(ps_, pr_, bb_, n_, c_) :=An(ps, pr, bb, n)*(lb1(ps, pr)^c - lb2(ps, pr)^c)+ xp(ps, pr, bb)*(1 - lb2(ps, pr)^c);
sfixed(n_, c_) := FullSimplify(xn(ps, pr, bb, n, c));
sol(s_, r_, bu_, n_, c_) :=sfixed(n, c) /. {ps -> s, pr -> r, bb -> bu};
ordres(n_) :=Module({i, x}, x = StringForm("0ToString(StringForm("sol(s,r,b,``,``)ToString(StringForm("sol(s,r,b,``,``)<1", n, n - 1)));

The function commands should produce the restriction for n points. Here I can not do the plot for n = 2.

Manipulate(RegionPlot({ToExpression(ordres(2))}, {r, 0, 1}, {b, 0, 0.2}, WorkingPrecision -> 1000), {s, 0.8, 1})

I expect that

Manipulate(RegionPlot({{sol(s, r, b, 2, 1) > 0 && sol(s, r, b, 2, 1) < 1}}, {r,0, 1}, {b, 0, 0.2}, WorkingPrecision -> 1000), {s, 0.8, 1})

Plotting – How do I set PlotRange-> All for data with uncertainties and prevent pruning error bars?

Mathematica 12 provides built-in plot support for data with error bars.

The following example looks good with the default settings:

ListPlot[Table[Around[i, 5], {i, 10}]]

Correct the plot area

However, if I sit down PlotRange->Allthe error bars are cut off:

ListPlot[Table[Around[i, 5], {i, 10}], PlotRange -> All]

Error bar cut off

Here's an example where PlotRange truncates error bars by default:

ListPlot[{Table[{i, Around[1/i, {-10, 10}]}, {i, -5.5, 5.5, 1.0}], 
          Table[{i, 3 i}, {i, 0.5, 5.5, 1.0}]}]

Error bar cut off

and add PlotRange->All does not help either:

ListPlot[{Table[{i, Around[1/i, {-10, 10}]}, {i, -5.5, 5.5, 1.0}], 
          Table[{i, 3 i}, {i, 0.5, 5.5, 1.0}]}, 
         PlotRange -> All]

Error bar cut off

Is there a universal option to retrieve the full PlotRange for data with error bars?

Plotting – Error in parameter variation

h = -5; k = 0;
ParametricPlot({{(t - Sin(t) + h), (1 - Cos(t))}, {(Cos(t) - 
     1), (t - Sin(t)) + k} }, {t, 0, 2 Pi}, PlotLabel -> Cycloid_OT, 
 PlotStyle -> {Red, Thick}, GridLines -> Automatic)
ParametricPlot(
 Evaluate@Table({{(t - Sin(t) + h), (1 - Cos(t))}, {(Cos(t) - 
       1), (t - Sin(t)) + k} }, {h, -5, 5, 1}), {t, 0, 2 Pi}, 
 PlotLabel -> Cycloid_OT, PlotStyle -> {Red, Thick}, 
 GridLines -> Automatic)

The two cycloids have gradients that multiply $ -1 $,

I try to create a network of land by varying $ h $ and $ k $,

But $ h $ itself is a mistake.

The illustration is intended to show that not all intersections are orthogonal, through visual inspection.

Thanks for the error correction.

Plotting – Error visualizing with ListDensityPlot3D

I have a list of data points with the elements {x, y, z, F (x, y, z)} that I want to draw with ListDensityPlot3D. (x, y, z) are the points on the surface of the sphere in the Cartesian system, and F (x, y, z) is an integer in the range of 0 to 12. Seems simple, but I repeatedly get the following error message.

visualizationVectorFieldsListScalarProcessData3D :: vfldata

Clicking on the error message will not explain anything in Mathematica.

Here are some of the data points.

X={{0., 0., 1., 3}, {0.0461835, 0., 0.998933, 1}, {0.0922684, 0., 
  0.995734, 1}, {0.138157, 0., 0.99041, 1}, {0.18375, 0., 0.982973, 
  1}, {0.22895, 0., 0.973438, 6}, {0.273663, 0., 0.961826, 
  6}, {0.317791, 0., 0.948161, 6}, {0.361242, 0., 0.932472, 
  6}, {0.403921, 0., 0.914794, 6}, {0.445738, 0., 0.895163, 
  6}, {0.486605, 0., 0.873622, 6}};

Would be glad about any help!

Calculus and Analysis – Plotting the inverse function of a complicated function

So I have a function

F(x_) = Assuming({Element(x, Reals), -1 < x < 1}, 
           Integrate(1/Sqrt((x^2 - 1)^2 + alpha*x), x))

I am now interested in the inverse function:

G(x_)=InverseFunction(F)(x)

But I do not get an answer from Mathematica ...

What I want to do is draw the inverse function. And to play with the values ​​of $ alpha $ You're welcome.

thank you in advance