MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Plot resolution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65084] Re: [mg65064] Plot resolution
  • From: "David Park" <djmp at earthlink.net>
  • Date: Tue, 14 Mar 2006 06:00:02 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

You can obtain Ted Ersek's PrecisionPlot routine from the Wolfram
MathSource. This routine is also included in the DrawGraphics package.

ro = 10^3;
pressure = p[r] /.
   DSolve[{D[p[r], r] == 1/(r^2*(1 + r)^3) - Log[1 + r]/
         (r^3*(1 + r)^2), p[ro] == 10^(-7)}, p[r], r][[1]]

PrecisionPlot[pressure, {r, ro, 10^4},
    PlotRange -> All,
    Frame -> True,
    Axes -> False,
    ImageSize -> 450];

gives a smooth monotonic plot.

For those who have DrawGraphics, the following gives a custom plot with
antialiasing used to give a smooth curve and simplifying tick labeling on
the y axis.

Needs["DrawGraphics`DrawingMaster`"]

yticksleft = CustomTicks[10^(-7) + #1/10^13 & , {-20, 0, 5, 5}];
yticksright = CustomTicks[10^(-7) + #1/10^13 & , {-20, 0, 5, 5},
    CTNumberFunction -> ("" & )];
DoAntiAliasing[Draw2D[{AntiAliasing[{Black, Linen}, 15, 0.008][
      FineGrainLines[10^(-14), 4, Abs[#2 - #1][[2]] & ][
       PrecisionDraw[pressure, {r, ro, 10^4}]]],
     Text["Pressure = "N[10^(-7) + \[CapitalDelta]/10^13], {4357.83,
9.99998/10^8},
      {-1, 0}]}, Frame -> True, FrameTicks -> {Automatic, yticksleft,
      Automatic, yticksright}, FrameLabel -> {r, \[CapitalDelta]},
PlotRange -> All,
    PlotLabel -> "Pressure vs. r", Background -> Linen,
    ImageSize -> 500]];

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/

From: Laurentiu Caramete [mailto:laurentiu.caramete at googlemail.com]
To: mathgroup at smc.vnet.net



Hi,

I got a problem with a plot of a function. The function 'pressure' should
decrease monotonically with r. The Plot function is giving a non-monotonic
plot at big r, this is a problem with the resolution of the plot or with the
function? How can I check that?

\!\(Clear[r]\[IndentingNewLine]
  \(ro = 10\^3;\)\[IndentingNewLine]
  \(pressure =
      p[r] /. \(DSolve[{D[p[r], r] ==
                1\/\(\(r\^2\) \((1 + r)\)\^3\) -
                  Log[1 + r]\/\(\(r\^3\) \((1 + r)\)\^2\),
              p[ro] == 10\^\(-7\)}, p[r],
            r]\)[\([1]\)];\)\[IndentingNewLine]\[IndentingNewLine]
  Plot[pressure, {r, ro, 10\^4}, PlotRange -> All]\)


Thanks




  • Prev by Date: Re: Re: Mathematica and Education
  • Next by Date: Re: Fourier expansion of (Cos[t]+A Cos[3 t])^1/3
  • Previous by thread: Re: Plot resolution
  • Next by thread: ShadowPlot3D