First, I apologize for the long script. It's if anyone wants to see the
issue first hand. The problem is that when I use twinx() to plot two
different functions on the same axes, the legend from the first part is
overwritten by the grid lines of the second part (after the twinx()
statement). As you can see in the Plot function, I tried to use the
zorder to have the first legend drawn at the end but that doesn't work.
I can see two possibilities -
1) I still don't know how to use zorder, or ...
2) the twinx() statement somehow causes the zorder process to get reset
so that the first legend always gets drawn before the second function is
Thanks for any help,