MathGroup Archive 2007

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

Search the Archive

Re: plotting equations with units

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80810] Re: plotting equations with units
  • From: Szabolcs <szhorvat at gmail.com>
  • Date: Sun, 2 Sep 2007 02:58:35 -0400 (EDT)
  • Organization: University of Bergen
  • References: <fbaqpi$qbs$1@smc.twtelecom.net>

phillman5 wrote:
> If you have loaded the units package and have used units in your
> equations, is there an easy way to plot the equations?  For the y data
> you can easily divide by the 'units' to get a unitless number
> 
> Plot[eq/units,{x, start,end}]
> 
> but what about the x values?  If they have units, the plot functions
> croaks.  I suppose you can always make a table and use listplot, but
> there should be an easier way.  I have seen some people here with
> packages to download, is there a consensus on the best third part
> solution.  I'd like a universal solution that would work with other
> plotting functions too.
> 
> I am using version 6.

If e.g. x has a dimension of length, how about

Plot[Evaluate[eq/units /. x -> x Meter], {x, 0, 10}]

?  You need to decide on what units to use for the vertical ('units') 
and horizontal ('Meter') axis anyway.

Szabolcs


  • Prev by Date: Re: Decompose function into one function for each variable
  • Next by Date: Re: How to use InputField inside Manipulate?
  • Previous by thread: Re: rotating rings illusion
  • Next by thread: Re: plotting equations with units