MathGroup Archive 2000

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

Search the Archive

Re: PLEASE HELP!! Need to change symbols in LinearLogListPlot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg23817] Re: PLEASE HELP!! Need to change symbols in LinearLogListPlot
  • From: Hartmut Wolf <hwolf at debis.com>
  • Date: Sat, 10 Jun 2000 03:00:26 -0400 (EDT)
  • Organization: debis Systemhaus
  • References: <393C5787.A5363CB5@r.imap.itd.umich.edu>
  • Sender: owner-wri-mathgroup at wolfram.com

Rodney Agayan schrieb:
> 
> Having enormous trouble figuring out how to change the symbol in
> LinearLogListPlot, or any type of ListPlot for that matter.
> 
> Changing symbols is relatively easy in MultipleListPlot, however doing
> such in LinearLogListPlot has confounded me.  Can anyone help?
> 
> On the other hand, if anyone knows how to modify MultipleListPlot so
> that it plots lists on Linear-Log scales, that would be greatly
> appreciated!!!
> 

Rodney,

I only answered the first part of your question, so now for the second:

For that we add modified ("patched" say) code to Graphics`Graphics` such as to
fulfill your wishes:

As ever, we first define the test data:

<< Graphics`MultipleListPlot`
<< Graphics`Graphics`

t1 = Table[Exp[n^2], {n, 0, 10}];
t2 = Reverse[t1];

LinearLogListPlot[t1, PlotJoined -> True]

LinearLogListPlot[t2, PlotJoined -> True]


Now we tweak this function

?ScaledListPlot

"ScaledListPlot[data] generates a plot with each data point scaled by \
functions specified in the ScaleFunction option."


It only allows for a single List as data, but we define a container for multiple
Lists:

Multiple::"usage" = 
    "Container for multiple Lists in the LogList plots as to get them drawn \
together with the features of MultipleListPlot";


Now the trick (tweaks at (*XXX*)):

Begin["Graphics`MultipleListPlot`Private`"]

ScaledListPlot[pdata_Multiple(*XXX*), opts___?OptionQ] := 
  Module[{scale, g, r, xs, ys, lopts, disp, 
      ao}, {scale, disp, 
        ao} = {ScaleFunction, DisplayFunction, AxesOrigin} /. 
          Flatten[{opts}] /. Options[ScaledPlot];
    lopts = FilterOptions[MultipleListPlot(*XXX*), ##] & @@ Flatten[{opts}];
    data = 
      MapIndexed[
        Switch[#1, {_?numberQ, _?numberQ}, #, _?numberQ, {Last(*XXX*)[#2], #1},
_, 
            Message[ScaledListPlot::sptn, #]; Null] &, pdata, {2}(*XXX*)];
    data = DeleteCases[data, Null];
    If[Head[scale] =!= List, scale = {scale, scale}];
    If[Length[scale] > 2, scale = Take[scale, 2]];
    {xs, ys} = scale;
    g = MultipleListPlot(*XXX*)[
        Sequence @@ (*XXX*)Map[{xs[#[[1]]], ys[#[[2]]]} &, data, {2}(*XXX*)], 
        DisplayFunction -> Identity, lopts];
    r = PlotRange[g];
    If[ao === Automatic, ao = Map[#[[1]] &, r], 
      ao = {xs[First[ao]], ys[Last[ao]]}];
    Show[g, DisplayFunction -> disp, PlotRange -> r, AxesOrigin -> ao]]
End[]

?? ScaledListPlot


First of all we must intrude into the privacy of Graphics`Graphics` 

2nd we define an additional interface for our multiple lists (kept in the
container "Multiple").

We replace all occurances of ListPlot by MultipleListPlot

4th fixing the data must be done at one level lower ({2} in Map, the replacement
of First with Last may be considered as an error fix).

Finally we remove the container for MultipleListPlot

that's all.



Now try

t3 = Transpose[{Range[11], Table[10^6, {11}]}];

LinearLogListPlot[Multiple[t1, t2, t3], PlotJoined -> True]

It worked for me.


I didn't test more, since this was a quick hack in my lunch hour (so you owe me
one!) I would ask you (and everyone interested) to try this out for different
log list plots and for options esp. the special opts for MultipleListPlot.


Kind regards,   Hartmut Wolf



  • Prev by Date: Derivative of Root objects
  • Next by Date: Need help with integration.
  • Previous by thread: Re: PLEASE HELP!! Need to change symbols in LinearLogListPlot
  • Next by thread: Re: PLEASE HELP!! Need to change symbols in LinearLogListPlot