Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11704 > unrolled thread

Re: DiagramPlot and PlanarGraphPlot colors

Started byBob Hanlon <hanlonr357@gmail.com>
First post2012-09-11 06:54 +0000
Last post2012-09-11 06:54 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: DiagramPlot and PlanarGraphPlot colors Bob Hanlon <hanlonr357@gmail.com> - 2012-09-11 06:54 +0000

#11704 — Re: DiagramPlot and PlanarGraphPlot colors

FromBob Hanlon <hanlonr357@gmail.com>
Date2012-09-11 06:54 +0000
SubjectRe: DiagramPlot and PlanarGraphPlot colors
Message-ID<k2mn7u$537$1@smc.vnet.net>
Needs["ComputationalGeometry`"]

data2D = {
   {4.4, 14}, {6.7, 15.25}, {6.9, 12.8},
   {2.1, 11.1}, {9.5, 14.9}, {13.2, 11.9},
   {10.3, 12.3}, {6.8, 9.5}, {3.3, 7.7},
   {0.6, 5.1}, {5.3, 2.4}, {8.45, 4.7},
   {11.5, 9.6}, {13.8, 7.3}, {12.9, 3.1},
   {11, 1.1}};

p1 = DiagramPlot[data2D];

p2 = PlanarGraphPlot[data2D];

Graphics[{
  Red,
  AbsoluteThickness[1.5],
  Tooltip[
   Cases[p1, Line[_], Infinity],
   "Diagram Plot"],
  Green,
  Tooltip[
   Cases[p2, Line[_], Infinity],
   "Planar Graph Plot"],
  Black,
  Cases[p1, Text[x__] :>
    Style[Text[x], Bold, 14], Infinity]}]


Bob Hanlon


On Mon, Sep 10, 2012 at 4:04 AM, Dave Snead <dsnead6@charter.net> wrote:
> Hi,
>
> I'm showing two plots p1 and p2 on top of each other,
> but I'd like to show them in two different colors,
> say red and green.
> Anybody know how to do this?
>
> Here's the code with both plots in black:
>
> Needs["ComputationalGeometry`"]
> data2D = {{4.4, 14}, {6.7, 15.25}, {6.9, 12.8}, {2.1, 11.1}, {9.5,
>     14.9}, {13.2, 11.9}, {10.3, 12.3}, {6.8, 9.5}, {3.3, 7.7}, {0.6,
>     5.1}, {5.3, 2.4}, {8.45, 4.7}, {11.5, 9.6}, {13.8, 7.3}, {12.9,
>     3.1}, {11, 1.1}};
> p1 = DiagramPlot[data2D]
> p2 = PlanarGraphPlot[data2D]
> Show[{p1, p2}]
>
> Thanks in advance,
> Dave
>
>

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web