Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder1.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Karl Ratzsch Newsgroups: comp.graphics.apps.gnuplot Subject: Re: auto caluclation for data display Date: Mon, 22 Jun 2015 15:19:04 +0200 Organization: solani.org Lines: 36 Message-ID: References: <94ad6511-e08e-4e88-87b3-df6b6f6ff876@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Trace: solani.org 1434979144 26749 eJwNycEBwCAIA8CVUCCh41gw+4/Q3vfSsdAMJCKV2u+wSJ7oWZrItnqubWxTtUv3P4k4HPPUByGJEXU= (22 Jun 2015 13:19:04 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Mon, 22 Jun 2015 13:19:04 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 X-User-ID: eJwFwQERACAIA8BKzjE444BC/wj+iw6/YS43jSarERQbvWfjMTU8kbN8G8ZYqAfV483V63wgQRFB In-Reply-To: Cancel-Lock: sha1:78HBqjhw13Z1+n3pikHYG40TU9Q= X-NNTP-Posting-Host: eJwNysEVACEIA9GWwE2Qdtgo/Zcgx3l/+IWHNoIBNhtXpE8JppPY5orTGqo0yPCvO3uu6hLWAxm4ESk= Xref: csiph.com comp.graphics.apps.gnuplot:2948 Am 22.06.2015 um 09:06 schrieb Jörg Buchholz: > On 18.06.2015 21:40, Jörg Buchholz wrote: >> On 18.06.2015 14:01, Syed Jahanzaib wrote: > ... > if (STATS_max_y >= (1024*1024)) { > set ylabel "Data Downloaded in GB" > plot "data.txt" using 1:($2/1024/1024) with impulse title "Daily > Usage" lw 10,\ > "data.txt" using 1:($2/1024/1024):(sprintf("%.0f",$2/1024/1024)) > with labels offset 0,1 > } else { > if (STATS_max_y >= 1024) { > set ylabel "Data Downloaded in MB" > plot "data.txt" using 1:($2/1024) with impulse title "Daily Usage" > lw 10,\ > "data.txt" using 1:($2/1024):(sprintf("%.0f",$2/1024)) with labels > offset 0,1 > } else { > set ylabel "Data Downloaded in KB" > plot "data.txt" using 1:2 with impulse title "Daily Usage" lw 10,\ > "data.txt" using 1:2:(sprintf("%.0f",$2)) with labels offset 0,1 > }} > > The stats command must be done before you set the xdata to time format. > > Jörg > gnuplot has all the onboard tools to do this in two lines: set format y "%.b %B" plot dataf using 1:2: w impulse,\ dataf using 1:2:(gprintf("%.b %B",$2) w labels ;-)