Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #2944
| From | Jörg Buchholz <bookwood4new@freenet.de> |
|---|---|
| Newsgroups | comp.graphics.apps.gnuplot |
| Subject | Re: auto caluclation for data display |
| Date | 2015-06-18 21:40 +0200 |
| Organization | A noiseless patient Spider |
| Message-ID | <mlv6o7$6hf$1@dont-email.me> (permalink) |
| References | <94ad6511-e08e-4e88-87b3-df6b6f6ff876@googlegroups.com> |
On 18.06.2015 14:01, Syed Jahanzaib wrote:
> greetings all,
>
> I am graphing downloads for the user account, but issue is the divide
> forumla. Is there any method in which gnuplot can auto measure the
> data like if its in KB , it should it in KB, if its in MB, it should
> show MB, if its in GB it should GB or vise verse for TB.
Do you want it for ploting labels at the bars or as ylabel? I think
there is only one ylabel for one graph.
> at a moment I am dividing the formula like /1024/1024 to get data in
> GB which have issue that if data is less then GB, it shows 0.xxx
If you need to scale the whole yaxis you can first use the stats command
to get the maximum of your data.
stats "data.txt" u 1:2
max_y = STATS_max_y
This give you the maximum of column 2 into the variable "max_y"
Than you can work with "if" and "else".
if max_y > a than
set ylabel 'GB'
plot "data.txt" u 1:($2/1024/1024)
else{If max_y > b than
set ylabel 'MB'
plot "data.txt" u 1:($2/1024)
else set ylabel 'KB'
plot "data.txt" u 1:2}
This not the real code for gnuplot, it is only a way to do something
like you want. For including TB, you need a 4 step "if/else" argument.
Jörg
Back to comp.graphics.apps.gnuplot | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
auto caluclation for data display Syed Jahanzaib <aacable79@gmail.com> - 2015-06-18 05:01 -0700
Re: auto caluclation for data display Jörg Buchholz <bookwood4new@freenet.de> - 2015-06-18 21:40 +0200
Re: auto caluclation for data display Jörg Buchholz <bookwood4new@freenet.de> - 2015-06-22 09:06 +0200
Re: auto caluclation for data display Karl Ratzsch <mail.kfr@gmx.net> - 2015-06-22 15:19 +0200
Re: auto caluclation for data display Jörg Buchholz <bookwood4new@freenet.de> - 2015-06-22 19:08 +0200
Re: auto caluclation for data display Karl Ratzsch <mail.kfr@gmx.net> - 2015-06-22 22:47 +0200
Re: auto caluclation for data display Karl Ratzsch <mail.kfr@gmx.net> - 2015-06-22 22:58 +0200
Re: auto caluclation for data display Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2015-06-22 22:54 +0200
Re: auto caluclation for data display Jörg Buchholz <bookwood4new@freenet.de> - 2015-06-23 08:53 +0200
csiph-web