DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Graph creation based on non-cumulative X-values

 
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions
View previous topic :: View next topic  
Author Message
Roberto



Joined: 16 Mar 2008
Posts: 102
Location: Netherlands Beek en Donk

PostPosted: Fri Dec 27, 2013 4:49 pm    Post subject: Graph creation based on non-cumulative X-values Reply with quote

Hi,

One or actually two feature requests:

DPlot only shows 2D graps correctly if all x values "have the same distance".
- Sometimes I have to deal with an incomplete data set
(e.g. measuring device that takes more samples when measured value changes faster or a data set that is taken manually but some samples were missed or not valid).
- or since recently data that is stored as time, value - some other time,value - some other time, value (time intervals vary). Source is a (Lascar EL-USB-5) eventlogger which records events by voltage level, rising or falling edge or contact status.

I, and probably others, too, would like DPlot be able to handle such non-sequential data sets. E.g. in general:
0.0 - Y
0.5 - Y
1.0 - Y
1.2 - Y gets interesting; more samples are taken
1.4 - Y
1.5 - Y
1.6 - Y
(importing this into DPlot the graph gets severely distorted)

or in the eventlogger case:
sample# - datetime - Yvalue
10,2013-12-26 22:03:13.3,1
11,2013-12-26 22:03:24.3,0
12,2013-12-26 22:28:28.5,1
13,2013-12-26 22:28:39.8,0
14,2013-12-26 22:53:42.0,1
15,2013-12-26 22:53:53.3,0
16,2013-12-26 23:18:55.0,1
17,2013-12-26 23:19:06.0,0
18,2013-12-26 23:44:07.5,1
19,2013-12-26 23:44:18.5,0
20,2013-12-27 00:09:21.5,1
(this looks like a zero-line with short spikes: Y-value of 0 for 30min, followed by Y-value of 1 for 10 sec) etc.).
If I import this into DPlot nothing is left from the short spikes: instead it becomes a 50% dutycycle triangle curve.

UPDATE:
David, in an other post you recommended DigitizeIt. Recently tried and actually bought it but I noticed it's a great example of the first issue I described above: the produced datasets don't have subsequent x-values and it goes even further: more of the same x-values but with different y-values! This is going to involve quite a bit of prep work Smile
_________________
Roberto
Back to top
View user's profile Send private message
jsc



Joined: 02 Dec 2005
Posts: 222

PostPosted: Mon Dec 30, 2013 12:31 am    Post subject: Reply with quote

Roberto,

Completely wrong impression of DPlot. DPlot plots the true X-Y data point, regardless of regular spacing or not. If you know the concept of line graphs vs. xy plots in Excel, then you should know DPlot is always in an "XY" mode of graphing. THE TRICK IS to make sure the data you are feeding DPlot is properly interpreted.

Does this plot the way you expect it to:
sample# datetime Yvalue
10 12/26/2013 22:03:13.3 1
12/26/2013 22:03:24.3 1
11 12/26/2013 22:03:24.3 0
12/26/2013 22:28:28.5 0
12 12/26/2013 22:28:28.5 1
12/26/2013 22:28:39.8 1
13 12/26/2013 22:28:39.8 0
12/26/2013 22:53:42.0 0
14 12/26/2013 22:53:42.0 1
12/26/2013 22:53:53.3 1
15 12/26/2013 22:53:53.3 0
12/26/2013 23:18:55.0 0
16 12/26/2013 23:18:55.0 1
12/26/2013 23:19:06.0 1
17 12/26/2013 23:19:06.0 0
12/26/2013 23:44:07.5 0
18 12/26/2013 23:44:07.5 1
12/26/2013 23:44:18.5 1
19 12/26/2013 23:44:18.5 0
12/27/2013 00:09:21.5 0
20 12/27/2013 00:09:21.5 1

If the original way that you presented the data is what comes out of the data logger, I don't think anything would interpret it correctly unless something was customized for the particular application.

Hope I didn't miss your point.

Jon

(My paste from Excel is a little buggered up, but hope you see what I did.)
Back to top
View user's profile Send private message
Roberto



Joined: 16 Mar 2008
Posts: 102
Location: Netherlands Beek en Donk

PostPosted: Mon Dec 30, 2013 8:54 pm    Post subject: Reply with quote

Hi Jon,

Hmm, at first glance the extended dataset indeed does the trick.
Did you do that manually or can it be done in a spreadsheet semi-automatically? I mean, the example was short but in real life there might be many more entries.
Still, since Dplot supports quite some input formats, I thought this kind of data would be useful to be recognized, too: time + value ...keep value constant upto next...time + value, etc. Normally DPlot connects lines between y-values while a bar graph-like approach (lines proceeding horizontally and jumping up or down vertically to new Y-value at next x-value.
Yes, the eventlogger comes with graph VIEW software which can deal with that kind of data; export to csv produces the same data as the original txt file.

Oh my, was I always so wrong? I have to check DPlot's x/y behavior again soon. I know I always had trouble with loading data from a battery charger: when the battery voltage stays relatively constant a lower sample rate is applied but when the edges become steeper the sample rate is increased for higher accuracy. Non-equal spacing between x-values caused the data imported in DPlot to look the graph distorted (locally stretched). I will check this out again.
_________________
Roberto
Back to top
View user's profile Send private message
Roberto



Joined: 16 Mar 2008
Posts: 102
Location: Netherlands Beek en Donk

PostPosted: Tue Dec 31, 2013 1:20 pm    Post subject: Reply with quote

Update:

I noticed "Make step plot" does exactly alter the data (adding values) in a way like suggested.
Image is right; only somehow the tops and bottoms between events are not connected (only vertical spikes are shown).

Strange because when I create a similar data set using just numbers (instead of date/time) then the result is exactly as expexted from the data set (tops and bottoms connected with horizontal lines)
Guess it's behaving like that on purpose when x-data is in date/time format.

Perhaps option for the "make step plot" feature? Or a second make step plot feature slightly differently named?
_________________
Roberto
Back to top
View user's profile Send private message
jsc



Joined: 02 Dec 2005
Posts: 222

PostPosted: Tue Dec 31, 2013 1:54 pm    Post subject: Reply with quote

Roberto,

I just tried the step plot - yes it does seem to do what you want - change the extents to + and - values of what your data limits are (ie, -1 and +2_ - everything is "connected".

(and previously, yes, I manually added the data points. I'd probably create a small basic program to modify the data if I had to do a larger set.)
Back to top
View user's profile Send private message
Roberto



Joined: 16 Mar 2008
Posts: 102
Location: Netherlands Beek en Donk

PostPosted: Wed Jan 01, 2014 9:59 am    Post subject: Reply with quote

Hi jsc,

Do you mean increasing the upper and lower Y-extents?
If I do that (original: 0 and 1) using e.g. Ymin=-1 and Ymax=2 I get this result:
__|___|___ and not the supposed __|ŻŻ|__

Technically I can let the event logger record date/time of detected rising edges only, falling edges only, rising and falling edges both (edges of signal voltage or a potential free contact being (un)powered.
The first picture would be perfectly correct for the first two cases (dataset would contain half the number of data) but for the third case (rising and falling edges recorded the second picture makes much more sense (can immediately see which periods the event is active or not).

I will experiment a bit more with manually entered values but I suspect as soon as I use a time format for the x-axis the upper limits won't be connected with a line (which DPlot normally does for a numeric X-axis).
_________________
Roberto
Back to top
View user's profile Send private message
jsc



Joined: 02 Dec 2005
Posts: 222

PostPosted: Wed Jan 01, 2014 5:14 pm    Post subject: Reply with quote

Looks like checking "Step Placement > Backward" will do the trick.
Back to top
View user's profile Send private message
Roberto



Joined: 16 Mar 2008
Posts: 102
Location: Netherlands Beek en Donk

PostPosted: Wed Jan 01, 2014 8:06 pm    Post subject: Reply with quote

Hi jsc,

SORRY!

The previous one (step plot forward) DOES let the graph exactly look like it is supposed to!
Problem is the example I gave you which was an older dataset: that set was an event cycle with about every 25 minutes an event of only 10 sec!
You can imagine the events remain to look like spikes until the graph is zoomed in a lot: doing so the lines are properly connected.

Latest tests were like 20s low, 10s high for a while already: that's why I suspected the given example to look like obvious blocks and not like spikes.

Anyway, here a dataset that shows clearly "Make Step plot" (Forward) does it well (have to change min/max Y-extends, though, to see horizontal connecting lines -or increase line thickness works also -kind of-).

218,2013-12-30 20:40:06.2,1
219,2013-12-30 20:40:14.0,0
220,2013-12-30 20:40:22.5,1
221,2013-12-30 20:40:30.3,0
222,2013-12-30 20:40:38.5,1
223,2013-12-30 20:40:46.3,0
224,2013-12-30 20:40:54.8,1
225,2013-12-30 20:41:02.6,0
226,2013-12-30 20:41:10.8,1
227,2013-12-30 20:41:18.6,0
228,2013-12-30 20:41:26.8,1
229,2013-12-30 20:41:34.8,0
230,2013-12-30 20:41:43.0,1
231,2013-12-30 20:41:50.8,0
232,2013-12-30 20:41:59.0,1
233,2013-12-30 20:42:06.8,0
234,2013-12-30 20:42:15.3,1
235,2013-12-30 20:42:23.1,0
236,2013-12-30 20:42:31.3,1
237,2013-12-30 20:42:39.1,0
238,2013-12-30 20:43:03.6,1
239,2013-12-30 20:43:11.4,0
240,2013-12-30 20:43:19.6,1
241,2013-12-30 20:43:43.6,0
242,2013-12-30 20:43:51.8,1
243,2013-12-30 20:43:59.6,0
244,2013-12-30 20:44:08.1,1
245,2013-12-30 20:44:15.9,0
246,2013-12-30 20:44:24.1,1
247,2013-12-30 20:44:31.9,0
248,2013-12-30 20:44:40.1,1
249,2013-12-30 20:45:04.1,0
250,2013-12-30 20:45:12.3,1
251,2013-12-30 20:45:20.1,0
252,2013-12-30 20:45:28.3,1
253,2013-12-30 20:45:36.3,0
254,2013-12-30 20:45:44.5,1
255,2013-12-30 20:45:52.3,0
256,2013-12-30 20:46:00.5,1
257,2013-12-30 20:46:08.3,0

Case closed, I guess Very Happy

Again sorry for unnecessary inconveniences.
_________________
Roberto
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group