Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #1660 > unrolled thread
| Started by | marcelojara@gmail.com |
|---|---|
| First post | 2013-02-23 19:25 -0800 |
| Last post | 2013-02-26 07:47 -0800 |
| Articles | 10 — 5 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
Gnuplot 4.6 bug? lines not being drawn marcelojara@gmail.com - 2013-02-23 19:25 -0800
Re: Gnuplot 4.6 bug? lines not being drawn Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2013-02-24 18:06 +0100
Re: Gnuplot 4.6 bug? lines not being drawn Karl <mail.kfr@gmx.net> - 2013-02-25 13:04 +0100
Re: Gnuplot 4.6 bug? lines not being drawn marcelojara@gmail.com - 2013-02-25 09:00 -0800
Re: Gnuplot 4.6 bug? lines not being drawn Christoph Bersch <usenet@bersch.net> - 2013-02-25 19:59 +0100
Re: Gnuplot 4.6 bug? lines not being drawn Karl <mail.kfr@gmx.net> - 2013-02-25 21:36 +0100
Re: Gnuplot 4.6 bug? lines not being drawn Hans-Bernhard Bröker <HBBroeker@t-online.de> - 2013-02-25 23:39 +0100
Re: Gnuplot 4.6 bug? lines not being drawn Marcelo Jara <marcelojara@gmail.com> - 2013-02-25 13:54 -0800
Re: Gnuplot 4.6 bug? lines not being drawn Karl <mail.kfr@gmx.net> - 2013-02-26 09:32 +0100
Re: Gnuplot 4.6 bug? lines not being drawn Marcelo Jara <marcelojara@gmail.com> - 2013-02-26 07:47 -0800
| From | marcelojara@gmail.com |
|---|---|
| Date | 2013-02-23 19:25 -0800 |
| Subject | Gnuplot 4.6 bug? lines not being drawn |
| Message-ID | <25126f7c-fe89-45d1-ba39-9c0aa8006efa@googlegroups.com> |
Hello, I've just started using Gnuplot 4.6 this week. I am trying to plot only certain data. Here is an example: plot 'data.txt' using 1:(stringcolumn(3) eq "a"? $2:1/0) notitle with lines This works fine if I use "with dots", "with impules", etc. But it does not draw anything when I use "with lines" or "with steps". Is this a known issue? Thanks.
[toc] | [next] | [standalone]
| From | Hans-Bernhard Bröker <HBBroeker@t-online.de> |
|---|---|
| Date | 2013-02-24 18:06 +0100 |
| Message-ID | <aouvknFg9u0U1@mid.dfncis.de> |
| In reply to | #1660 |
On 24.02.2013 04:25, marcelojara@gmail.com wrote: > plot 'data.txt' using 1:(stringcolumn(3) eq "a"? $2:1/0) notitle with lines > This works fine if I use "with dots", "with impules", etc. But it > does not draw anything when I use "with lines" or "with steps". > Is this a known issue? That's pretty impossible to tell without seeing at least a sample of the actual data. But do note that 'with lines' only connects consecutive points in your data file. Blank lines interrupt the line, so it may be that your line consists of nothing but interruptions, which would make it no line at all.
[toc] | [prev] | [next] | [standalone]
| From | Karl <mail.kfr@gmx.net> |
|---|---|
| Date | 2013-02-25 13:04 +0100 |
| Message-ID | <kgfk11$1mi$1@news.rz.uni-karlsruhe.de> |
| In reply to | #1660 |
Am 24.02.2013 04:25, schrieb marcelojara@gmail.com: > Hello, > > I've just started using Gnuplot 4.6 this week. I am trying to plot only certain data. Here is an example: > > plot 'data.txt' using 1:(stringcolumn(3) eq "a"? $2:1/0) notitle with lines > > > This works fine if I use "with dots", "with impules", etc. But it does not draw anything when I use "with lines" or "with steps". > > Is this a known issue? > Yes. Lines are only drawn between consecutive points (try "with linespoints"). One way out of this might be: gp> plot "data" using (stringcolumn(3) eq "a" ? $1 : 1/0) : 2 \ smooth unique with lines (haven´t tried, btw. ;-)) Smooth unique renders the data monotonic, so all the invalid points (which are now invalid on x instead of y) should land outside of the plot. Karl
[toc] | [prev] | [next] | [standalone]
| From | marcelojara@gmail.com |
|---|---|
| Date | 2013-02-25 09:00 -0800 |
| Message-ID | <613ac8bf-9fbc-4f34-bc54-7b6c4aa894e8@googlegroups.com> |
| In reply to | #1660 |
Thanks Karl. Unfortunately that didn't work either. Here is an example of my actual data: 02222013083723,ServerA,586950936,1709,20817,3.510409 02222013083723,ServerB,659800656,1702,20920,8.715981 02222013083724,ServerC,873737176,1745,21133,5.4260693 02222013083724,ServerD,1043938832,1716,20898,4.24047 02222013083745,ServerA,623933280,1682,20817,5.815545 02222013083745,ServerB,692769240,1674,20922,6.93751 02222013083745,ServerC,704775144,1704,21133,7.0087843 02222013083746,ServerD,731880448,1706,20898,6.9982367 02222013083806,ServerA,605951920,1609,20817,7.0428286 02222013083807,ServerB,753759440,1599,20937,4.6636114 02222013083807,ServerC,1140883088,1630,21133,5.761619 02222013083807,ServerD,926288920,1614,20899,7.0784245 02222013083828,ServerA,622904272,1601,20817,3.4892871 02222013083828,ServerB,756817136,1591,20937,8.244981 02222013083828,ServerC,1030568704,1622,21133,14.123659 02222013083828,ServerD,1120398200,1601,20902,4.7675056 There is a script that goes out to different servers and grabs some metrics. It then sends the data to a metrics file. In the case above, there are four servers. The last data point (6) is the CPU utilization. My goal is to create one graph with the CPU utilization of all 4 servers on it. A line graph would be perfect here. This is what I use to plot ServerA CPU: plot 'test.txt' using 1:(strcol(2) eq "ServerA"? $6:$1/0) To plot all 4 CPU's, I would use: plot 'test.txt' using 1:(stringcolumn(2) eq "ServerA"? $6:1/0) title "ServerA" ,\ 'test.txt' using 1:(stringcolumn(2) eq "ServerB"? $6:1/0) title "ServerB" ,\ 'test.txt' using 1:(stringcolumn(2) eq "ServerC"? $6:1/0) title "ServerC" ,\ 'test.txt' using 1:(stringcolumn(2) eq "ServerC"? $6:1/0) title "ServerD" This would create a graph with an different color of 'X' for each data point. This is difficult to see when you start adding more servers. Being able to draw one line for each server CPU would be great. Is there any other way to do this? The plot command I used above is basically taken from an older post in a support group to plot filtered data. Maybe with Gnuplot 4.6, there is a different way to do this? If you want to plot the data above yourself, use these parameters: set xdata time set format x "%H:%M" set timefmt x "%m%d%Y%H%M%S" set datafile separator "," On Saturday, February 23, 2013 10:25:12 PM UTC-5, marce...@gmail.com wrote: > Hello, > > > > I've just started using Gnuplot 4.6 this week. I am trying to plot only certain data. Here is an example: > > > > plot 'data.txt' using 1:(stringcolumn(3) eq "a"? $2:1/0) notitle with lines > > > > > > This works fine if I use "with dots", "with impules", etc. But it does not draw anything when I use "with lines" or "with steps". > > > > Is this a known issue? > > > > Thanks.
[toc] | [prev] | [next] | [standalone]
| From | Christoph Bersch <usenet@bersch.net> |
|---|---|
| Date | 2013-02-25 19:59 +0100 |
| Message-ID | <kggc85$dcl$1@dont-email.me> |
| In reply to | #1666 |
Am 25.02.2013 18:00, schrieb marcelojara@gmail.com: > > 02222013083723,ServerA,586950936,1709,20817,3.510409 > 02222013083723,ServerB,659800656,1702,20920,8.715981 > 02222013083724,ServerC,873737176,1745,21133,5.4260693 > 02222013083724,ServerD,1043938832,1716,20898,4.24047 > 02222013083745,ServerA,623933280,1682,20817,5.815545 > > This is what I use to plot ServerA CPU: > plot 'test.txt' using 1:(strcol(2) eq "ServerA"? $6:$1/0) Try plot '< grep "ServerA" test.txt' u 1:6 with lines For the explanation see Hans-Bernhard's posting. Christoph
[toc] | [prev] | [next] | [standalone]
| From | Karl <mail.kfr@gmx.net> |
|---|---|
| Date | 2013-02-25 21:36 +0100 |
| Message-ID | <kggi09$g9g$1@news.rz.uni-karlsruhe.de> |
| In reply to | #1666 |
Tried now too, and it cannot work. H.-B. and Christoph are right, you´ll have to sort or filter your data externally, using 'grep' or the like. > The plot command I used above is basically taken from an older post in a support group to plot filtered data. Can you post that older post (or a link) ? I wonder how they managed to make it work. Karl
[toc] | [prev] | [next] | [standalone]
| From | Hans-Bernhard Bröker <HBBroeker@t-online.de> |
|---|---|
| Date | 2013-02-25 23:39 +0100 |
| Message-ID | <ap27gkF6h08U1@mid.dfncis.de> |
| In reply to | #1666 |
On 25.02.2013 18:00, marcelojara@gmail.com wrote: > There is a script that goes out to different servers and grabs some > metrics. It then sends the data to a metrics file. This would all be a _lot_ easier if you just kept the data from separate servers in separate files. After all, what good does it do you to collect all the data in a single file if all you ever do with that is split it back up into individual streams?
[toc] | [prev] | [next] | [standalone]
| From | Marcelo Jara <marcelojara@gmail.com> |
|---|---|
| Date | 2013-02-25 13:54 -0800 |
| Message-ID | <0e5f9801-2b71-4539-9f04-315621bfae75@googlegroups.com> |
| In reply to | #1660 |
On Saturday, February 23, 2013 10:25:12 PM UTC-5, Marcelo Jara wrote: > Hello, > > > > I've just started using Gnuplot 4.6 this week. I am trying to plot only certain data. Here is an example: > > > > plot 'data.txt' using 1:(stringcolumn(3) eq "a"? $2:1/0) notitle with lines > > > > > > This works fine if I use "with dots", "with impules", etc. But it does not draw anything when I use "with lines" or "with steps". > > > > Is this a known issue? > > > > Thanks. Well, it works without using "with lines". Here's the post: http://getthedata.org/questions/603/parsing-csv-data-into-gnuplot/
[toc] | [prev] | [next] | [standalone]
| From | Karl <mail.kfr@gmx.net> |
|---|---|
| Date | 2013-02-26 09:32 +0100 |
| Message-ID | <kghrv6$2j8$1@news.rz.uni-karlsruhe.de> |
| In reply to | #1669 |
Am 25.02.2013 22:54, schrieb Marcelo Jara: > > Well, it works without using "with lines". > > Here's the post: > http://getthedata.org/questions/603/parsing-csv-data-into-gnuplot/ > "with lines" only connects points that are directly succeeding in the order they are read from a data file, _before_ the evaluation of a "using" statement. 1/0 does count as a data point, in that sense. There is just no chance to get them to connect without external filtering. One could think of defining a special value that, when read, makes gnuplot skip the line _and_ connect the points before and after, but that would be for the developers. Karl
[toc] | [prev] | [next] | [standalone]
| From | Marcelo Jara <marcelojara@gmail.com> |
|---|---|
| Date | 2013-02-26 07:47 -0800 |
| Message-ID | <9d6d643b-13fe-4e3d-bc48-a668649f5fdc@googlegroups.com> |
| In reply to | #1660 |
Thanks for everyone's help. Christoph's suggestion did work for me (using 'grep'). Here's the final statement: plot '<grep "ServerA" test.txt' u 1:6 title "ServerA" with lines, \ '<grep "ServerB" test.txt' u 1:6 title "ServerB" with lines, \ '<grep "ServerC" test.txt' u 1:6 title "ServerC" with lines, \ '<grep "ServerD" test.txt' u 1:6 title "ServerD" with lines I guess for Windows, I would need to change it to 'find', but haven't tested it yet. There is no technical reason as to why I have the different servers' metrics in one file. I am responsible for stress testing applications and servers. When a test starts, I grab all the metrics for all the relevant servers. I stop grabbing the metrics when the test ends. For me, it was easier to have one file per test that represented all the performance metrics. Otherwise, I would have 8 or more files per test. There are definitely different ways to do this and could easily have written the metrics to separate files and then possibly join the files after using Gnuplot. Thanks again.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web