Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2322 > unrolled thread
| Started by | Anton Puhlwetter <anton.puhlwetter@web.de> |
|---|---|
| First post | 2014-03-01 16:49 +0100 |
| Last post | 2014-03-04 18:05 +0100 |
| Articles | 6 — 4 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
Fitting in current xrange Anton Puhlwetter <anton.puhlwetter@web.de> - 2014-03-01 16:49 +0100
Re: Fitting in current xrange Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2014-03-01 18:49 +0100
Re: Fitting in current xrange Anton Puhlwetter <anton.puhlwetter@web.de> - 2014-03-02 00:10 +0100
Re: Fitting in current xrange Alex van der Spek <zdoor@xs4all.nl> - 2014-03-02 15:30 +0000
Re: Fitting in current xrange Ethan A Merritt <EAMerritt@gmail.com> - 2014-03-01 20:02 -0800
Re: Fitting in current xrange Anton Puhlwetter <anton.puhlwetter@web.de> - 2014-03-04 18:05 +0100
| From | Anton Puhlwetter <anton.puhlwetter@web.de> |
|---|---|
| Date | 2014-03-01 16:49 +0100 |
| Subject | Fitting in current xrange |
| Message-ID | <lesvj1$kqq$1@news.albasani.net> |
Hi, using the fit command, it is possible to specify ranges for the dummy variables, and only values inside this range are considered for fitting. Is it possible to automatically use the current xrange and/or yrange for fitting? The reason why I want to achieve this is the following: Sometimes, I have e.g. spectra with lots of gaussian peaks I want to fit. My desired workflow is: - Zoom into the region of the n-th peak - Make gnuplot determine mean and sigma as starting parameters - fit a gaussian for the /current/ xrange - copy the results from console to a separate file - zoom out and into the next peak's environment Is there a way to achieve this? Best regards, Anton
[toc] | [next] | [standalone]
| From | Hans-Bernhard Bröker <HBBroeker@t-online.de> |
|---|---|
| Date | 2014-03-01 18:49 +0100 |
| Message-ID | <bnekt2Fiat6U1@mid.dfncis.de> |
| In reply to | #2322 |
On 01.03.2014 16:49, Anton Puhlwetter wrote: > using the fit command, it is possible to specify ranges for the dummy > variables, and only values inside this range are considered for > fitting. How could you possibly have failed to notice the information on how to do this, given it's literally the first thing explained in "help fit" after the command syntax?
[toc] | [prev] | [next] | [standalone]
| From | Anton Puhlwetter <anton.puhlwetter@web.de> |
|---|---|
| Date | 2014-03-02 00:10 +0100 |
| Message-ID | <letpdf$9bf$1@news.albasani.net> |
| In reply to | #2323 |
Hello,
> How could you possibly have failed to notice the information on how
> to do this, given it's literally the first thing explained in "help
> fit" after the command syntax?
I suppose you are talking about this part of the help:
> Ranges may be specified to temporarily limit the data which is to be
> fitted; any out-of-range data points are ignored. The syntax is
>
> [{dummy_variable=}{<min>}{:<max>}],
I am aware that I can use this to specify a range /if I know the boundaries/. E.g., I can write:
| fit [0:10] f(x) 'data.dat'...
or even
| fit [xmin:xmax] f(x) ...
but in these cases, I have to know in advance the boundaries I want to use for fitting. What I am looking for are things like one of the following:
| fit CURRENT_X_RANGE f(x)...
| fit [XRANGE_MIN:XRANGE_MAX] f(x)
My problem is: I do not know the values in advance, because I want to use wxt's interactive features to select a region of my graph, and then run the fit with the /current visible region/. I don't want to run show xrange and copy the values into fit, because finally, I want to run the fit by just hitting a hotkey.
I hope I was able to make clear that my problem is not literally the first line of the documentation.
Best regards,
Anton
[toc] | [prev] | [next] | [standalone]
| From | Alex van der Spek <zdoor@xs4all.nl> |
|---|---|
| Date | 2014-03-02 15:30 +0000 |
| Message-ID | <53134eb2$0$2833$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #2324 |
Plot your data, then zoom interactively. Then type "show variables all" at the command prompt. GPVAL_XMIN and GPVAL_XMAX are what you need. Alex van der Spek
[toc] | [prev] | [next] | [standalone]
| From | Ethan A Merritt <EAMerritt@gmail.com> |
|---|---|
| Date | 2014-03-01 20:02 -0800 |
| Message-ID | <levvjc$n7d$1@dont-email.me> |
| In reply to | #2324 |
Anton Puhlwetter wrote:
> Hello,
>
>> How could you possibly have failed to notice the information on how
>> to do this, given it's literally the first thing explained in "help
>> fit" after the command syntax?
>
> I suppose you are talking about this part of the help:
>
>> Ranges may be specified to temporarily limit the data which is to be
>> fitted; any out-of-range data points are ignored. The syntax is
>>
>> [{dummy_variable=}{<min>}{:<max>}],
>
> I am aware that I can use this to specify a range /if I know the
> boundaries/. E.g., I can write:
>
> | fit [0:10] f(x) 'data.dat'...
>
> or even
>
> | fit [xmin:xmax] f(x) ...
>
> but in these cases, I have to know in advance the boundaries I want to
> use for fitting. What I am looking for are things like one of the
> following:
>
> | fit CURRENT_X_RANGE f(x)...
> | fit [XRANGE_MIN:XRANGE_MAX] f(x)
Close. What you want is
fit [x=GPVAL_X_MIN:GPVAL_X_MAX] ...
It may be informative to type "show var GPVAL" before and
after zooming.
Ethan
>
> My problem is: I do not know the values in advance, because I want to
> use wxt's interactive features to select a region of my graph, and
> then run the fit with the /current visible region/. I don't want to
> run show xrange and copy the values into fit, because finally, I want
> to run the fit by just hitting a hotkey.
>
> I hope I was able to make clear that my problem is not literally the
> first line of the documentation.
>
> Best regards,
> Anton
[toc] | [prev] | [next] | [standalone]
| From | Anton Puhlwetter <anton.puhlwetter@web.de> |
|---|---|
| Date | 2014-03-04 18:05 +0100 |
| Message-ID | <lf515l$vqv$1@news.albasani.net> |
| In reply to | #2330 |
Hello, > Close. What you want is > fit [x=GPVAL_X_MIN:GPVAL_X_MAX] ... Indeed, this is what I was looking for. Thank you, Anton
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web