LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create an even spacing on the Xaxis of an XY plot even if the data points do not seem to be evenly spaced (but indeed are)?

Hello -

 

  I am plotting 3 variables against date in an XY plot.  The variable on the X axis is the date in the format YMMDD.  Each day has one set of data.

  When I use a waveform graph (ignoring the date data), the graph appears to be correct.

  When I use the XY graph (using the date data), the graph appears to be incorrect.  I think that this problem is because of the way my date data is stored.  When the data goes from December 31 2007 to January 1 2008, there is a large "gap" in the data (71231 ---> 80101).  Even though the X-axis data is evenly spaced (...3 variables per day..), the data appears to be incorrect on the graph.

 

  Is there a way to adjust the spacing on the X-axis so that my data appears to be normal?

 

  I have attached a screenshot of the 2 graphs.  The top graph is what the data should look like.  The bottom graph shows the issue that I am attempting to describe.

  I have also attached a screenshot of the XY graph section of my code.

 

  Thanks!

 

DS

Download All
0 Kudos
Message 1 of 3
(2,474 Views)

Well, if you simply feed the graph "71231" and "80101", there's no way for it to treat those the same as if you fed it "80101" and "80102".  You're feeding it NUMBERS and expecting it to treat them as DATES.

 

Look in the DATE/TIME functions.  There's lots of functions to turn "71231" into a TIMESTAMP, which will then be usable for graphs, or even arithmetic (80101 - 71231 = 86400.00).

You'll have to parse out the month/day/year, and convert those to seconds. DATE/TIME to SECONDS is the one I think you want.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 3
(2,467 Views)

Let me hasten to add: If what you are STORING is supposed to be a DATE, then use the GET DATE/TIME IN SECONDS function to begin with, and lose the ASCII translations.  Just store the Timestamp

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 3
(2,465 Views)