|
From: D <dcm...@we...> - 2016-08-03 07:53:05
|
Yes, ok, it's not a bug. But from a beginners perspective I just wanted to plot a graph and at least in log mode I had to "set sample <n>" for the graph to reach the bottom and top axis and be fully drawn. There's basically no fast way to know that this was necessary. I don't know but maybe at least some helpful warning should appear when one uses a certain xy range, specially in log mode (I know it is not limited to log mode)? Also of course the log ticks looked ok up to a certain xrange and I had to use: "set mxtics 10 # see "help set mxtics" set mytics 10" Seems also not beginner friendly or kinda buggy (because it works to a certain range and then not). Anyways I just see possible improvements to be made here for a next version. On 03.08.2016 00:08, Ethan Merritt wrote: > There is no bug here - you are fighting the limits of floating point > precision. > Consider the final steps that are sampled as x approaches 10000. > For linear sampling in steps of 100 > > f(9800) is 490000.000000002 > f(9900) is 990000.00000001 > f(10000) is inf (divide by zero at IEEE floating precision) > > So f(9900) is the last point that shows on the plot, and that value is > less > than the y range you have chosen. The function reaches ymax (10^7) at > f(9990.) > To catch that on your plot you must sample finely enough to > distinguish 9990 from 10000. > > And that's for linear sampling. In logscale the sampling must be even > finer. > The program selects even samples along the x axis (even spacing on > log(x)). > So most of the samples are at low values of x. > > On Sun, Jul 31, 2016 at 5:16 AM, D <dcm...@we... > <mailto:dcm...@we...>> wrote: > > Thanks. I had to 'set sample' to 500000 for gnuplot to plot the > whole line (slightly different xy range and the line goes to the > bottom). Works in linear mode without the need for any 'set > sample', wonder why the log mode requires that at all. Maybe you > should fix that for v5.1 too. > > > On 29.07.2016 20:52, Ethan Merritt wrote: >> 1) version 5.0: >> set mxtics 10 # see "help set mxtics" >> set mytics 10 >> >> version 5.1 >> currently a bug. thanks for the report >> >> 2) set sample 10000 >> Or else define the functions as parametric so that the sample is >> independent of the x/y precision. >> But increasing the number of samples is easier. >> >> On Fri, Jul 29, 2016 at 11:28 AM, D <dcm...@we... >> <mailto:dcm...@we...>> wrote: >> >> Hi, using: >> >> set terminal pngcairo truecolor enhanced font "arial,11" >> fontscale 1.0 >> size 1000,1000 >> set output "test.png" >> >> set log xy >> #set logscale xy >> >> set xrange [100:1e7] >> set yrange [100:1e7] >> >> set grid xtics ytics mxtics mytics lt 0 lw 1 lc rgb "#000000" >> >> f(x) = x/ (1-0.0001*x) >> fi(x) = x/(1/(1-0.0001*x)) >> g(x) = x/ (1-0.0000001*x) >> gi(x) = x/(1/(1-0.0000001*x)) >> id(x) = x >> >> plot f(x) lt 2 lc rgb "#ff0000" lw 1 , \ >> fi(x) lt 2 lc rgb "#ff0000" lw 1 , \ >> g(x) lt 2 lc rgb "#ff0000" lw 1 , \ >> gi(x) lt 2 lc rgb "#ff0000" lw 1 , \ >> id(x) dashtype 2 lc rgb "#000000" lw 1 >> >> 1) the grid tick lines look either incorrect or at least not >> to what >> they look up to [100:1e6]. How can I make them work with >> [100:1e7] ? >> 2) the plot of the lines does neither go to the bottom >> (fi,gi), nor to >> the top (f,g), as expected. How to fix? >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> gnuplot-info mailing list >> gnu...@li... >> <mailto:gnu...@li...> >> Membership management via: >> https://lists.sourceforge.net/lists/listinfo/gnuplot-info >> >> > > |