How do I do a double Y axis plot in M9?

I heard that was finally part of M9…

I just heard it is not in M9. Hoping for 9.1…

However this code is still a good way to do it:

data = Accumulate[RandomReal[{-0.8, 1}, 1000]];
{ListLinePlot, ListLinePlot[Accumulate]}

accdata = Accumulate;
scaledTicks[origmin_, origmax_][min_, max_] := Block[{major, minor},
  {major, minor} =   FindDivisions[Rescale[{min, max}, {0, 1}, {origmin, origmax}], {5, 5}];
  minor = Flatten;
  major = {Rescale[#, {origmin, origmax}, {0, 1}], #} & /@ major;
  minor = {Rescale[#, {origmin, origmax}, {0, 1}], Spacer[{0, 0}]} & /@ 
   minor;
  Join[major, minor]
  ];
ListLinePlot[{Rescale[data, {Min, Max}, {0, 1}], 
  Rescale[accdata, {Min, Max}, {0, 1}]}, 
 FrameTicks -> {{scaledTicks[Min, Max], 
    scaledTicks[Min, Max]}, {Automatic, Automatic}}, 
 Frame -> True, 
 FrameStyle -> {{ColorData[1, 1], ColorData[1, 2]}, {Automatic, Automatic}}]

Just a note from the higher-education front lines:
The two y-axis feature is a request/question that I field regularly for new student users and colleagues.
I’ve passed along a variation of the rescale technique when asked, but the reception is not generally very enthusiastic.
So, here is a small plea for inclusion into 9.1.

Agree. Luc Barthelet does a service by showing how this can be done within Mathematica as it exists, but there is no need for it to be so challenging. Add one more vote for making this capability more accessible.

This is a huge omission from Mathematica. When trying to get other’s on board with Mathematica, the lack of the feature creates a huge frustration for the new users. Coding a 2nd y-axis leaves them scrambling back to Matlab or Excel.

Hi,
See also hyperlink
http://community.wolfram.com/groups/-/m/t/446298?p_p_auth=n8a8lT2n

Jos

I don’t know if this qualifies as being easier - it seems easier to me. The Presentations Application, which I sell through my web site, has had various forms of CustomTicks for years. It will automatically generate the major and minor ticks for you and allows any kind of monotonic scaling. And I found and pasted in the CustomTicks options using the nifty OptionsFinder, which also comes with Presentations, thanks to Thomas Münch and Syd Geraghty. So using Luc’s example:

<< Presentations`

data1 = Accumulate[RandomReal[{-0.8, 1}, 1000]];
data2 = Accumulate[data1];

rescale[x_] := Rescale[x, {0, 60000}, {0, 120}];
yRightTicks = CustomTicks[rescale, {0, 60000, 20000, 4},
   CTTickSpecs -> 2 {0.0125`, 0}, 
   CTNumberFunction -> (Style[#, Red] &)];
Draw2D[
 {ListDraw[data1],
  ListDraw[rescale /@ data2, PlotStyle -> Red]},
 AspectRatio -> 1/2,
 PlotRange -> {{0, 1000}, {0, 120}},
 PlotRangePadding -> {20, 5},
 Frame -> True,
 FrameTicks -> {{Automatic, yRightTicks}, {Automatic, Automatic}},
 ImageSize -> 300]