MathGroup Archive 2005

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

Search the Archive

Re: Mathematical Modeling Problem II

  • To: mathgroup at smc.vnet.net
  • Subject: [mg59556] Re: [mg59523] Mathematical Modeling Problem II
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Fri, 12 Aug 2005 00:08:25 -0400 (EDT)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200508110855.EAA24671@smc.vnet.net>
  • Reply-to: murray at math.umass.edu
  • Sender: owner-wri-mathgroup at wolfram.com

Adding graphics "primitives" such as lines, circles, polygons, etc., is 
readily accomplished using the built-in Epilog (or Prolog) option to Plot.

But I heartily recommend a somewhat smoother, more intuitive, way to do 
this, by using David Park's DrawGraphics package.  This free add-on may 
be downloaded from:

   http://home.earthlink.net/~djmp/Mathematica.html

(Scroll down about 2/3 of the way to find "The DrawGraphics Paradigm" 
there.)


Here's the sort of thing you wanted, using Park's package:

   Needs["DrawGraphics`DrawingMaster`"]

   Draw2D[{EnglishRed, Draw[Exp[-x], {x, 0, 2}],
           Peacock, Thickness[0.01], Line[{{1, 0}, {1, 1}}]
          }, Axes -> True];


Here's the same thing but using only built-in objects and one of the 
Standard AddOn packages that ships with Mathematica:

   Needs["Graphics`Colors`"]

   Plot[Exp[-x], {x, 0, 2}, PlotStyle -> CadmiumOrange,
        Epilog -> {Turquoise, Thickness[0.01], Line[{{1, 0}, {1, 1}}]}];

The advantage of this latter approach is that you do not have to learn 
the syntax of any new add-on package.  The advantage of Park's 
DrawGraphics approach is that both Plot-like objects (the "Draw" object 
above) and graphics primitives are treated uniformly.

Sycamor at gmail.com wrote:
> Hello.  I am a high school student working on a summer research project
> at a local university.  My task is to model a certain physical
> situations using Mathematica.  I am still ignorant of the programs
> profound, and not-so-profound secrets.  At the moment, I find myself
> unable to plot a vertical line.  How does one create a vertical line
> and show that line on the same axes as a set of data points?  Ideally,
> I would also like to keep the vertical scale the same.
> 
> In my quest for a vertical line, I have tried using very steep curves,
> and using the ImplicitPlot package.  I expect I am missing something
> very obvious.  
> 
> Thank you very much,
> 
> Peter Hedman
> 
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: Mathematical Modeling Problem II
  • Next by Date: Re: Re: Re: Mathematica 5.2 and mathssh
  • Previous by thread: Re: Mathematical Modeling Problem II
  • Next by thread: Re: Mathematical Modeling Problem II