How to combine separate month and year columns into one column in igor?
lyggd
I have one question that How to combine separate month and year columns into one column in igor and make the igor read as MM/YEAR?
Thank you very much.
Yi
DisplayHelpTopic "Date/Time Waves"
Now here is an example that illustrates how to do what you asked about:
Make/O/N=(3*4) year = 2000 + trunc(p/4)
Make/O/N=(3*4) month = mod(3*p+1,12)
Edit year, month
// Make a wave to hold date/time data
Make/O/N=(3*4)/D dt // Wave must be double-precision
dt = date2secs(year, month, 1) // Create date/time values from the year and month
SetScale d, 0, 0, "dat", dt // Tell Igor it is a date/time wave
AppendToTable dt
// Make a graph using the dt wave for the X axis
Make/O/N=(3*4) someData = p
Display someData vs dt
// Set the date format of the X axis. I generated this command using the
// Date Format popup menu in the Ticks&Grids tab of the Modify Axis dialog.
ModifyGraph dateInfo(bottom)={0,0,-1},dateFormat(bottom)={Default,2,2,1,2,"Month/Year",16}
// Set the bottom axis label
Label bottom "\\u#2Date" // \\u suppresses Igor's default units mechanism
February 10, 2014 at 08:10 pm - Permalink