Page 1 of 1

Zooming for interactive fitting

Posted: Thu May 04, 2017 5:49 am
by katarkon
Somtimes it is necessary to expand certain area of the spectrum for better control of the fitting. I suggest it is possible without changin of esfit() function code by changing of 'XLim' property of corresponding subplot. The units of 'X' axis should be a numbers of data points. Is it so? Second problem is to obtain right handler for spectrum subplot. I try such code:

Code: Select all

esfit(...);
hAllAxes = findobj('type','axes');
But it returns several values. Which of them is right?

Re: Zooming for interactive fitting

Posted: Thu May 04, 2017 8:01 am
by Stefan Stoll
Use findobj('Tag','dataaxes').

Re: Zooming for interactive fitting

Posted: Fri May 05, 2017 3:55 am
by katarkon
Thanks, it works fine.

Re: Zooming for interactive fitting

Posted: Sun Jun 04, 2017 11:09 am
by thanasis
This is a very useful tip!

Just one question: from what I gather, the way to replot to the desired limits is to start the fit and go to the inspector and edit XLIm.x and XLim.y properties manually through the interface.

Is there a way to do this programmatically so that the given fit always starts the interactive window at the desired limits?

Thanks!

Re: Zooming for interactive fitting

Posted: Mon Jun 05, 2017 10:08 pm
by Stefan Stoll
There is no direct access to the scaling in the esfit plot.

That said, you could use a timer object in your Matlab startup file that runs the rescaling periodically, using findboj as given above. This is a terrible hack though.