## gnuplot-info

 [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? From: Tomás Navarro - 2011-04-26 19:07:08 ```Hello all. I have not found the way to solve the following problem: I want to plot a set of data in only one plot. The problem is that some points of the data should be better plotted in a linear scale (lets say 0 to 100,000) but there are other data points that, exceding the value 100,000, would be better plotted in a logarithmic scale, as they goes in the range 100,000 to 500,000,000. Let's say the data is: X Y 0 100 10000 80 20000 75 30000 60 40000 55 50000 50 60000 48 70000 45 80000 43 90000 41 100000 40 500000 35 1000000 30 5000000 25 10000000 20 50000000 15 100000000 10 500000000 8 (in fact there are much more data points in the 0-100,000 interval) Is there a way to plot all these points in the same plot in only one X-axis showing two different ranges in that axis: linear: 0-100,000 logarithmic: 100,000 - 1,000,000,000 ? The axis would be read, for example, as: |-----|-----|-----|-----|-----|-----|-----|-----|-----| 0 2E4 4E4 6E4 8E4 1E5 1E6 1E7 1E8 1E9 Thanks. ```
 [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? From: BBands - 2011-04-26 19:50:26 ```One approach might be to 'set log x2' log and plot the data once on x and once on x2 using the ternary operator eliminate the unwanted points. See 'help operators ternary' and 'help set logscale' for details.     jab On Tue, Apr 26, 2011 at 12:07 PM, Tomás Navarro wrote: > > Hello all. > > I have not found the way to solve the following problem: > > I want to plot a set of data in only one plot. > > The problem is that some points of the data should be better plotted in a > linear scale (lets say 0 to 100,000) but there are other data points that, > exceding the value 100,000, would be better plotted in a logarithmic scale, > as they goes in the range 100,000 to 500,000,000. > > Let's say the data is: > >     X       Y >        0   100 >    10000    80 >    20000    75 >    30000    60 >    40000    55 >    50000    50 >    60000    48 >    70000    45 >    80000    43 >    90000    41 >   100000    40 >   500000    35 >  1000000    30 >  5000000    25 >  10000000    20 >  50000000    15 > 100000000    10 > 500000000     8 > > (in fact there are much more data points in the 0-100,000 interval) > > Is there a way to plot all these points in the same plot in only one X-axis > showing two different ranges in that axis: > linear: 0-100,000 > logarithmic: 100,000 - 1,000,000,000 ? > > The axis would be read, for example, as: > > |-----|-----|-----|-----|-----|-----|-----|-----|-----| > 0    2E4   4E4   6E4   8E4   1E5   1E6   1E7   1E8   1E9 > Thanks. ```
 Re: [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? From: BBands - 2011-04-26 19:52:59 ```Here is an example: http://t16web.lanl.gov/Kawano/gnuplot/misc1-e.html jab ```
 Re: [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? From: Tomás Navarro - 2011-04-27 20:44:28 ```Thank you very much for the hint, jab, and also for that link I visited time ago and was not able to find this time. Tomás > Date: Tue, 26 Apr 2011 12:52:53 -0700 > Subject: Re: [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? > From: bbands@... > To: llaurollauro@... > CC: gnuplot-info@... > > Here is an example: > > http://t16web.lanl.gov/Kawano/gnuplot/misc1-e.html > > jab ```
 Re: [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? From: Thomas Sefzick - 2011-04-27 15:45:36 ```a list of methods you may use: 1. modify the x-values for x>100000 and set the xtics by hand 2. use x- and x2-axis 3. plot twice in multiplot mode reset set xtics ("0" 0, "2E4" 2e4, "4E4" 4e4, "6E4" 6e4, "8E4" 8e4, "1E5" 1e5, "1E6" 12e4, "1E7" 14e4, "1E8" 16e4, "1E9" 18e4) plot 'datafilename' using (\$1<100000?\$1:log10(\$1)*20000):2 with linespoints pause -1 reset set xrange [0:180000] set x2range [1e0:1e9] set xtics nomirror set log x2 set xtics 0,20000,100000 set x2tics 1e5,10 plot 'datafilename' using (\$1<=100000?\$1:0/0):2 with linespoints, \ '' using (\$1>=100000?\$1:0/0):2 ax x2y1 with linespoints pause -1 reset set yrange [0:100] set multiplot set xrange [0:180000] set xtics 0,20000,100000 plot 'datafilename' using (\$1<=100000?\$1:0/0):2 with linespoints set xrange [1e0:1e9] set log x set xtics 1e5,10 plot 'datafilename' using (\$1>=100000?\$1:0/0):2 with linespoints unset multiplot Tomás Navarro wrote: > > > Hello all. > > I have not found the way to solve the following problem: > > I want to plot a set of data in only one plot. > > The problem is that some points of the data should be better plotted in a > linear scale (lets say 0 to 100,000) but there are other data points that, > exceding the value 100,000, would be better plotted in a logarithmic > scale, > as they goes in the range 100,000 to 500,000,000. > > Let's say the data is: > > X Y > 0 100 > 10000 80 > 20000 75 > 30000 60 > 40000 55 > 50000 50 > 60000 48 > 70000 45 > 80000 43 > 90000 41 > 100000 40 > 500000 35 > 1000000 30 > 5000000 25 > 10000000 20 > 50000000 15 > 100000000 10 > 500000000 8 > > (in fact there are much more data points in the 0-100,000 interval) > > Is there a way to plot all these points in the same plot in only one > X-axis > showing two different ranges in that axis: > linear: 0-100,000 > logarithmic: 100,000 - 1,000,000,000 ? > > The axis would be read, for example, as: > > |-----|-----|-----|-----|-----|-----|-----|-----|-----| > 0 2E4 4E4 6E4 8E4 1E5 1E6 1E7 1E8 1E9 > Thanks. > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > gnuplot-info mailing list > gnuplot-info@... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/How-to-combine-a-linear-range-and-log-scale-range-in-the-same-X-axis--tp31481340p31488612.html Sent from the Gnuplot - User mailing list archive at Nabble.com. ```
 Re: [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? From: Tomás Navarro - 2011-04-27 21:04:21 ```Thank you very much for all three possibilities. Any of them solve the problem. I was trying myself the multiplot plan, but did not find the correct combination. Seems so easy reading them now! :) Tomás. > Date: Wed, 27 Apr 2011 08:45:30 -0700 > From: t.sefzick@... > To: gnuplot-info@... > Subject: Re: [Gnuplot-info] How to combine a linear range and log-scale range in the same X-axis? > > > a list of methods you may use: > 1. modify the x-values for x>100000 and set the xtics by hand > 2. use x- and x2-axis > 3. plot twice in multiplot mode > > reset > set xtics ("0" 0, "2E4" 2e4, "4E4" 4e4, "6E4" 6e4, "8E4" 8e4, "1E5" 1e5, > "1E6" 12e4, "1E7" 14e4, "1E8" 16e4, "1E9" 18e4) > plot 'datafilename' using (\$1<100000?\$1:log10(\$1)*20000):2 with linespoints > > pause -1 > > reset > set xrange [0:180000] > set x2range [1e0:1e9] > set xtics nomirror > set log x2 > set xtics 0,20000,100000 > set x2tics 1e5,10 > plot 'datafilename' using (\$1<=100000?\$1:0/0):2 with linespoints, \ > '' using (\$1>=100000?\$1:0/0):2 ax x2y1 with linespoints > > pause -1 > > reset > set yrange [0:100] > set multiplot > set xrange [0:180000] > set xtics 0,20000,100000 > plot 'datafilename' using (\$1<=100000?\$1:0/0):2 with linespoints > set xrange [1e0:1e9] > set log x > set xtics 1e5,10 > plot 'datafilename' using (\$1>=100000?\$1:0/0):2 with linespoints > unset multiplot > > > Tomás Navarro wrote: > > > > > > Hello all. > > > > I have not found the way to solve the following problem: > > > > I want to plot a set of data in only one plot. > > > > The problem is that some points of the data should be better plotted in a > > linear scale (lets say 0 to 100,000) but there are other data points that, > > exceding the value 100,000, would be better plotted in a logarithmic > > scale, > > as they goes in the range 100,000 to 500,000,000. > > > > Let's say the data is: > > > > X Y > > 0 100 > > 10000 80 > > 20000 75 > > 30000 60 > > 40000 55 > > 50000 50 > > 60000 48 > > 70000 45 > > 80000 43 > > 90000 41 > > 100000 40 > > 500000 35 > > 1000000 30 > > 5000000 25 > > 10000000 20 > > 50000000 15 > > 100000000 10 > > 500000000 8 > > > > (in fact there are much more data points in the 0-100,000 interval) > > > > Is there a way to plot all these points in the same plot in only one > > X-axis > > showing two different ranges in that axis: > > linear: 0-100,000 > > logarithmic: 100,000 - 1,000,000,000 ? > > > > The axis would be read, for example, as: > > > > |-----|-----|-----|-----|-----|-----|-----|-----|-----| > > 0 2E4 4E4 6E4 8E4 1E5 1E6 1E7 1E8 1E9 > > Thanks. > > > > ------------------------------------------------------------------------------ > > WhatsUp Gold - Download Free Network Management Software > > The most intuitive, comprehensive, and cost-effective network > > management toolset available today. Delivers lowest initial > > acquisition cost and overall TCO of any competing solution. > > http://p.sf.net/sfu/whatsupgold-sd > > _______________________________________________ > > gnuplot-info mailing list > > gnuplot-info@... > > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > > > > > -- > View this message in context: http://old.nabble.com/How-to-combine-a-linear-range-and-log-scale-range-in-the-same-X-axis--tp31481340p31488612.html > Sent from the Gnuplot - User mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > WhatsUp Gold - Download Free Network Management Software > The most intuitive, comprehensive, and cost-effective network > management toolset available today. Delivers lowest initial > acquisition cost and overall TCO of any competing solution. > http://p.sf.net/sfu/whatsupgold-sd > _______________________________________________ > gnuplot-info mailing list > gnuplot-info@... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info ```