Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Show two vector fields with different arrow colors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57131] Re: [mg57119] Show two vector fields with different arrow colors
  • From: Chris Chiasson <chris.chiasson at gmail.com>
  • Date: Tue, 17 May 2005 01:19:54 -0400 (EDT)
  • References: <200505170135.VAA23141@smc.vnet.net>
  • Reply-to: Chris Chiasson <chris.chiasson at gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

<<Graphics`PlotField`
Block[{$DisplayFunction=Identity},
  p1=PlotVectorField[{y,-x},{x,0,1},{y,0,1},
      DefaultColor\[Rule]RGBColor[1,0,0]];
  p2=PlotVectorField[{x,y},{x,0,1},{y,0,1},
      DefaultColor\[Rule]RGBColor[0,1,0]];]
Show@Graphics@
    MapThread[{#2,First@#1}&,{{p1,p2},{RGBColor[1,0,0],RGBColor[0,1,0]}}]

On 5/16/05, Niels L. Ellegaard <gnalle at ruc.dk> wrote:
> Dear Masters
> 
> I would like to plot two vector fields in the same graph. However I
> need the arrows of the two fields to have different colors. Is there a
> sneaky way to do this? I tried the following, but in the third plot
> all arrows become red.
> 
> p1 :=  PlotVectorField[{y,-x},{x,0,1},{y,0,1}, DefaultColor -> RGBColor[1, 0, 0]];
> p2 :=  PlotVectorField[{x,y},{x,0,1},{y,0,1}, DefaultColor -> RGBColor[0, 1, 0]] ;
> Show[p1,p2]
> 
>                 Thanks in advance
> 
>                         Niels
> 
> PS: I am using a slightly old version, so I cannot apply PlotVectorField to a list
> 
> In[53]:= $Version
> 
> Out[53]= Silicon Graphics 3.0 (September 16, 1997)
> 
> 


-- 
Chris Chiasson
http://chrischiasson.com/
1 (810) 265-3161


  • Prev by Date: Re: Re: Beginner : how to convert .bmp or .jpeg for digital processing
  • Next by Date: Re: Modifying displayed form of an expression?
  • Previous by thread: Show two vector fields with different arrow colors
  • Next by thread: Re: Plotting g(x,y) along contour of f(x,y)