MathGroup Archive 2002

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

Search the Archive

RE: Plotting mulitple lists on one log plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34478] RE: [mg34454] Plotting mulitple lists on one log plot
  • From: "David Park" <djmp at earthlink.net>
  • Date: Thu, 23 May 2002 03:32:20 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

John,

Show[plots...] and DisplayTogether are very persnickity in how they pick up
plot options. I would do it by converting your data points to log values and
directly plotting the data points wrapped in Line. However, we still get the
LogScale ticks directive from Graphics`Graphics`.

Needs["Graphics`Graphics`"]

Debonded = {{0., 81.5244}, {0.1, 5.81173}, {0.2, 3.53041}, {0.3,
        3.09363}, {0.4, 3.09363}, {0.5, 1.44145}, {0.6, 1.44145}, {0.7,
        0.522863}};

NoDistalCement = {{0., 71.8089}, {0.1, 8.1722}, {0.2, 6.51516}, {0.3,
        5.17021}, {0.4, 5.17021}, {0.5, 2.65144}, {0.6, 2.65144}, {0.7,
        0.697332}};

The following converts the data to log form.

LogDebonded = {#1, Log[10, #2]} & @@ # & /@ Debonded
{{0., 1.91129}, {0.1, 0.764305}, {0.2, 0.547825}, {0.3, 0.490468}, {0.4,
    0.490468}, {0.5, 0.1588}, {0.6, 0.1588}, {0.7, -0.281612}}

LogNoDistalCement = {#1, Log[10, #2]} & @@ # & /@ NoDistalCement
{{0., 1.85618}, {0.1, 0.912339}, {0.2, 0.813925}, {0.3, 0.713508}, {0.4,
    0.713508}, {0.5, 0.423482}, {0.6, 0.423482}, {0.7, -0.15656}}

Now, we can plot the two data sets directly.

Show[Graphics[
      {Line[LogNoDistalCement],
        AbsoluteThickness[2],
        GrayLevel[0.5],
        AbsoluteDashing[{5}],
        Line[LogDebonded]}],
    Frame -> True,
    FrameTicks -> {Automatic, LogScale, Automatic, None},
    FrameLabel -> {"Fraction",
        "  Percentage of cement\n satisfying probability"},
    PlotLabel -> "Probability of Failure",
    ImageSize -> 500
    ];

If you have your lists of data points, it is almost always easier to skip
routines like LogListPlot or MultipleListPlot and work directly in Graphics.
You can either Map Point (or some form of PlotSymbol) onto the point list,
or you can wrap it in Line, or you can do both to get the points and the
lines. The DrawGraphics package, at my web site, has a whole section in the
documentation on making log plots. It also has CustomTicks and
CustomGridLines for better control of ticks and grids.

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


> From: John Britton [mailto:brittojr at tcd.ie]
To: mathgroup at smc.vnet.net
>
> Dear Forum,
>
> I'm having a problem with using LogListPlot to plot multiple data
> sets on the
> same plot. Basically it will not format each individual data set
> line as I
> wish - Mathematica appears to ignore the PlotStyle option. Below
> I include
> the relevant lines of code. Mathematica version = 4.01 running on Linux
>
> *************
>
> Debonded = {{0., 81.5244}, {0.1, 5.81173}, {0.2, 3.53041}, {0.3,
>         3.09363}, {0.4, 3.09363}, {0.5, 1.44145}, {0.6, 1.44145}, {0.7,
>         0.522863}};
>
> NoDistalCement = {{0., 71.8089}, {0.1, 8.1722}, {0.2, 6.51516}, {0.3,
>         5.17021}, {0.4, 5.17021}, {0.5, 2.65144}, {0.6, 2.65144}, {0.7,
>         0.697332}};
>
> DisplayTogether[ LogListPlot[NoDistalCement, AxesLabel ->
> {"Probability of
> failure",   "Percentage of cement satisfying probability"},  PlotStyle ->
> {{Thickness[0.04], GrayLevel[0.5],
>           Dashing[{0.1, 0.5, 0.5, 0.5}]}}],
>   LogListPlot[Debonded, PlotJoined -> True]]
>
> **************
>
> If anyone has any ideas about how I can resolve this problem I'd be very
> grateful, and I will post a summary of responses. (Have searched the
> archives, web and Mathematica help to no avail).
>
> Thanks,
> John Britton
>
>   --
> Bioengineering Group,		Phone: +353 1 608 1976
> Trinity College,			Fax: +353 1 679 5554
> University of Dublin,
> Ireland
> www.biomechanics.ie
>
>



  • Prev by Date: RE: Speeding up hierarchical sorting
  • Next by Date: RE: Re: Help! How to calculate additive partitions?
  • Previous by thread: RE: Plotting mulitple lists on one log plot
  • Next by thread: MathML Conference: Registration Deadline Extension