Dual Axis Question
jasonjphillips
I have displacement vs. time plots on one graph that are in inches and seconds. I want a 2nd y-axis to be in centimeters for this data. Is there an easy way to do this in Igor without doing lots of data manipulation in Excel or Matlab?
At least one way quick way is to replot the data, hidden, with "muloffset" for the scale factor from inches to cm. For example:
•display/k=1 inches
•appendtograph/r inches
•variable cmPerInch = 2.54
•ModifyGraph muloffset(inches#1)={0,cmPerInch}
•Label right "cm."
•Label left "in."
•ModifyGraph hideTrace(inches#1)=2
One complication: the user has to be careful to make sure that the actual range of both vertical axes is the same, or else the axis for the trace scaled with muloffset may no longer be correct. This is unlikely to be a problem unless more traces are added to the plot or the axis ranges are changed.
August 6, 2018 at 03:47 pm - Permalink
The TransformAxis package (Graph menu->Packages->Transform Axis) with this transformation function would it:
Wave/Z w // a parameter wave, if desired. Argument must be present for FindRoots.
Variable val
return val*2.54
end
You would load the Transform Axis package via the menu item, then create a mirror axis choosing "InchesToCm" from the Function menu in the New Transform Axis panel. To learn more, choose File->Example Experiments->Graph Techniques->Transform Axis Demo.
August 6, 2018 at 04:55 pm - Permalink