MathGroup Archive 2007

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

Search the Archive

Re: Re: Non numerical x-axis in (Date)ListPlot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79026] Re: [mg78997] Re: [mg78986] Non numerical x-axis in (Date)ListPlot?
  • From: DrMajorBob <drmajorbob at bigfoot.com>
  • Date: Mon, 16 Jul 2007 02:15:10 -0400 (EDT)
  • References: <29106105.1184503723560.JavaMail.root@m35>
  • Reply-to: drmajorbob at bigfoot.com

That works fine, but I'm wondering why "PlotJoined" is color-coded red --  
indicating it's not a recognized option? (version 6.0.1)

Bobby

On Sun, 15 Jul 2007 00:08:08 -0500, Bob Hanlon <hanlonr at cox.net> wrote:

> The Sort included below is to cover the case when the data is not  
> pre-sorted by labels
>
> dat1 = {{"A1", 2}, {"A4", 1}, {"A2", 3}};
> dat2 = {{"A1", 2.2}, {"A3", 0.5}, {"A2", 2.9}, {"A4", 1.1}};
>
> xcoord = Union[Join @@ (#[[All, 1]] & /@ {dat1, dat2})];
>
> dat = Sort /@ ({dat1, dat2} /.
>      {x_, y_?NumericQ} :>
>       {Position[xcoord, x][[1, 1]], y});
>
> ListPlot[dat,
>  PlotJoined -> True,
>  Frame -> True,
>  FrameTicks -> {Thread[{Range[Length[xcoord]], xcoord}],
>    Automatic, None, None},
>  Epilog -> {AbsolutePointSize[4],
>    Thread[{{Blue, Red}, Map[Point, dat, {2}]}]}]
>
>
> Bob Hanlon
>
> ---- Maarten van der Burgt <maarten.vanderburgt at icos.be> wrote:
>> Dear all,
>>
>> I have two sets of data:
>>
>> dat1 = {{"A1",2},{"A2",3},{"A4",1}}
>> dat2 = {{"A1",2.2},{"A2",2.9},{"A3",0.5},{"A4",1.1}}
>>
>> Is there a simple way I can plot these with the {"A1", "A2", "A3",  
>> "A4"} as
>> equidistant tick marks/labels along the horizontal axis and a standard
>> numerical vertical axis?
>> Note the missing "A3" in dat1.
>>
>> I could not find anything in the options of ListPlot, or in the new  
>> (6.0)
>> DateListPlot.
>>
>> Thanks for your help,
>>
>> Maarten van der Burgt
>> Leuven, Belgium
>>
>>
>
>
>



-- 

DrMajorBob at bigfoot.com


  • Prev by Date: Re: change slider to pointed rectangle or arrow
  • Next by Date: an exploitation of the single vs. multi argument behavior of Unevaluated
  • Previous by thread: Re: Re: Non numerical x-axis in (Date)ListPlot?
  • Next by thread: Re: Re: Re: Non numerical x-axis in