MathGroup Archive 2005

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

Search the Archive

Re: rasterarray border?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56042] Re: [mg55989] rasterarray border?
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.com>
  • Date: Thu, 14 Apr 2005 08:54:38 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

>-----Original Message-----
>From: Manuel Marques-Pita [mailto:m.marques-pita at ed.ac.uk] 
To: mathgroup at smc.vnet.net
>Sent: Wednesday, April 13, 2005 7:10 AM
>Subject: [mg56042] [mg55989] rasterarray border?
>
>hello,
>
>I am drawing a rasterarray in which I need to draw a 
>border/stroke round 
>some of the elements in the array (all the ones != -1 below).
>
>Show[Graphics[RasterArray[von /.
>           {-1 -> RGBColor[1, 1, 1],
>             0 -> RGBColor[0.97, 0.97, 1],
>             1 -> RGBColor[0.3, 0, 0],
>             2 -> RGBColor[1, .78, .78]}]],
>     AspectRatio -> Automatic];
>
>I haven't found a way to do this yet, any ideas/suggestions?
>
>Thanks in advance!
>
>Manuel
>
>

If you call your raster graphics by rg, and 

  square = {{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}};

then


  Show[rg,
    Graphics[{Thickness[.02], Hue[.4, .3, 1], 
      Line /@ Outer[Plus, Position[Transpose[von], -1], square - 1,
1]}], 
    AspectRatio -> Automatic]

might do what you want.

Perhaps you like some fine tuning of square, according to Thickness,
e.g. use

  square1 = square /. {0 -> .05, 1 -> 1 - .05}


--
Hartmut Wolf


  • Prev by Date: Re: Algebra in Mathematica
  • Next by Date: Re: rasterarray border?
  • Previous by thread: Re: rasterarray border?
  • Next by thread: Re: rasterarray border?