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


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

Re: DiagramPlot and PlanarGraphPlot colors

From Bob Hanlon <hanlonr357@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: DiagramPlot and PlanarGraphPlot colors
Date 2012-09-11 06:54 +0000
Message-ID <k2mn7u$537$1@smc.vnet.net> (permalink)
References <20120909213324.167C06765@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


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
>
>

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web