X-Received: by 10.99.47.134 with SMTP id v128mr3537626pgv.27.1489000602008; Wed, 08 Mar 2017 11:16:42 -0800 (PST) X-Received: by 10.157.11.143 with SMTP id 15mr1167389oth.11.1489000601961; Wed, 08 Mar 2017 11:16:41 -0800 (PST) Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.glorb.com!w124no1191108itb.0!news-out.google.com!15ni8900itm.0!nntp.google.com!w124no1191104itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Wed, 8 Mar 2017 11:16:41 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=90.54.225.14; posting-account=zFNeegoAAABhytSqsm48qkJZ3P2KE-2e NNTP-Posting-Host: 90.54.225.14 References: <24ea3aba-292c-4afb-a4a8-59685203a23f@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <4e392809-c82f-4275-b1fc-23c9022afce8@googlegroups.com> Subject: Re: Strange thing about logscale after a fit ? From: Vincent Gouret Injection-Date: Wed, 08 Mar 2017 19:16:41 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: csiph.com comp.graphics.apps.gnuplot:3569 Le mercredi 8 mars 2017 20:01:05 UTC+1, Ethan A Merritt a =C3=A9crit=C2=A0: > Vincent Gouret wrote: >=20 > > Hello all, > >=20 > > I have a strange result for plotting data in logscale. The file I use > > contains this: > > -------------------- > > temps_gauss.txt: > >=20 > > 5 100000 4 > > 6 69444 4 > > 7 51020 4 > > 9 30863 5 > > 10 24999 5 > > 12 17360 6 > > 13 14791 7 > > 16 9764 9 > > 18 7714 11 > > 21 5667 15 > > 25 3998 22 > > 29 2971 31 > > 34 2161 47 > > 40 1561 70 > > 47 1130 110 > > 55 825 157 > > 64 609 232 > > 75 443 361 > > 88 321 552 > > 103 234 822 > > 120 172 1281 > > 141 124 2031 > > 165 90 3148 > > 193 65 4941 > > 227 46 7883 > > 265 33 12483 > > 311 23 19784 > > 364 16 31094 > > 427 11 50103 > > 501 7 80055 > > ---------------------- > > The first colum is the size of a linear problem, the second is the numb= er > > of random problems of this size and the last is the mean execution time= in > > us. The linear problem is solve using the Gauss algorithm. I plot this > > result in Gnuplot with: plot 'temps_gauss.txt' u 1:3 w p It work fine. = If > > I want to see the same plot with logscale, I do this: set logscale > > and when I redo the plot, all goes fine. After that, I do a fit like th= at: > > f(x)=3Dalpha*x**3 > > fit f(x) 'temps_gauss.txt' u 1:3 via alpha > > This works well and give me a value for alpha=3D6.4e-4, fine. Then I pl= ot > > the datas and the model, and at this time it does not work: plot > > 'temps_gauss.txt' u 1:3 w p, f(x) w l This give me the error: > > color axis has cb coord of 0; must be above 0 for log scale! > > If I stop gnuplot, and relaunch it, and type: > > f(x)=3Dalpha*x**3 > > set logscale > > alpha=3D6.4e-4 > > plot 'temps_gauss.txt' u 1:3 w p, f(x) w l > > then all goes fine ??? What is the problem ? I use gnuplot V5 patchleve= l > > 4, under Windows 8.1 or V5 patchlevel 3 under Lubuntu 16.04.2, the same= ... >=20 > The error occurs because=20 >=20 > - the command "set logscale" applies to all axes, not just x and y. =20 > - the default range for all axes in the absence of any input is [-10:10] > - if you actually use an axis in the plot, the program checks that the > range is reasonable, which in the case of log scale means=20 > adjusting the default it to be > 0 if necessary. > - unfortunately (here is the bug) the color axis range is not adjusted > for log scale because your plot does not actually use it. So the=20 > default range is incompatible with log scale and you get an error. > I do not know exactly how long this bug has been there, but I will file > a bug tracker item so that it gets fixed in the next gnuplot release. >=20 > To avoid the error, any one of the following is sufficient >=20 > - Only set log scale for x and y: > set log xy > - Clear log scale for the color axis: > unset log cb > - Set the range of the color axis to be >0 > set cbrange [1:*] >=20 >=20 > Ethan Thanks a lot Ethan, the only thing to to is to add tyour command: unset log cb and the problem goes away. Your remark about default range is not releavant= . Now it works :-)