Curve Fit Destination Overwritten [was Problem with mutiple-graph]

Hi All,
I try to make several scatter plots and curve fitting each one.
But every-time I fit one, the fitting line on other graph with also changed. Please check the file I attached.
Is there anyone can help me to solve this problem ?
Thank you very much.
Best Wishes
Experiment_3.pxp
hrodstein wrote:
Use the Rename operation to rename the destination wave after each curve fit.


Hello Hrodstein,
Sorry I still did not get it.
How to rename the destination wave after each curve fit ?
Would you give me more details ?
Thank you very much.
Yi
After fitting FC_W vs LD, execute this command on Igor's command line:
Rename fit_FC_W, fit_FC_W_vs_LD
Then when you do the next fit it won't overwrite the fit curve created by the previous fit.

You can also use Data->Rename and use the Rename Objects dialog.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
In both curve fits you are fitting Y wave FC_W. This is atypical and causes some problems that require some extra work.

The CurveFit operation /D flag automatically generates a destination wave named after the Y wave. In this case the automatic destination wave is fit_FC_W for both fits. Therefore the second CurveFit overwrites the destination from the first CurveFit.

The solution is to rename the destination wave with a unique name after each fit.

Before you start with that, execute these commands to fix the name of the righthand graph:
DoWindow/F Graph0   // Activate the lefthand graph - you could also just click it
DoWindow/C FC_W_VS_GC   // Change name of righthand graph to FC_W_VS_GC


Now execute these commands to remove the fit_FC_W from both graphs:
RemoveFromGraph/W=FC_W_VS_LD fit_FC_W
RemoveFromGraph/W=FC_W_VS_GC fit_FC_W


Now execute these commands to target the left graph, do the fit, and rename the destination wave:
DoWindow/F FC_W_VS_LD
CurveFit/X=1/H="10"/NTHR=1 line  FC_W /X=LD /D
Rename fit_FC_W, fit_FC_W_LD


Now execute these commands to target the right graph, do the fit, and rename the destination wave:
DoWindow/F FC_W_VS_GC
CurveFit/X=1/H="10"/NTHR=1 line  FC_W /X=GC /D
Rename fit_FC_W, fit_FC_W_GC


Now you have two destination waves with unique names.

If you want to redo the fit, for example the first fit, you must rename the destination wave back to the default name, do the fit, and then rename it to the unique name. Execute these commands:
DoWindow/F FC_W_VS_LD
Rename fit_FC_W_LD, fit_FC_W
fit_FC_W = 0    // This is not really necessary
CurveFit/X=1/H="10"/NTHR=1 line  FC_W /X=LD /D
Rename fit_FC_W, fit_FC_W_LD

Johnweeks and Hrodstein,
Thank you so much for the detail instruction !
I am very appropriated !
Yi