MathGroup Archive 2005

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

Search the Archive

Re: How do I add a secondary y-axis to MultipleListPlot

On 7/15/05 at 3:02 AM, ggroup at wrote:

>I have been trying to figure out if there is a way to plot two (or
>more) sets of data on one plot, but with different y-axes?  I have
>data that have different zero offsets and features on that are on
>different scales, but I would like to plot them on top of each

>This is fairly simple on an XY scatter plot in Excel, but of course
>Excel is extremely tedious to use for very large datasets.

There are a number of ways to approach this. One simple way to add a secondary axis would be to use a Frame and an approriate FrameTicks directive. For example,

Plot[{x, x^2}, {x, 0, 2}, PlotStyle -> {Black, Red}, 
   Axes -> None, Frame ->True, 
   FrameTicks -> {Automatic, Automatic, None, 
     Table[{n^2, n}, {n, 0.5, 4, 0.5}]}, 
   FrameLabel -> {"x", "y", None, "Sqrt[y]"}]; 

Using the DrawGraphics package David Parks wrote allows for more flexibility and more complex graphics.
To reply via email subtract one hundred and four

  • Prev by Date: Re: Light and surface colors
  • Next by Date: Notebook Style problems?
  • Previous by thread: Re: How do I add a secondary y-axis to MultipleListPlot
  • Next by thread: Graphical modeling of extinct lifeforms with Mathematica