prompt function to customize axis labels - cosmetic question
Code for graph is as follows...
<br />
Macro Makediurnal(JDayStr,wave2avgStr,waveAvgStr)<br />
String JDayStr, wave2avgStr, waveAvgStr="my_avg"<br />
prompt JDayStr, "JDay of the data for the diurnal?",popup SortList(WaveList("*",";",""), ";", 16)<br />
prompt wave2avgStr, "Data for the diurnal?",popup SortList(WaveList("*",";",""), ";", 16)<br />
prompt waveAvgStr, "Name to give the diurnal wave?"<br />
<br />
if (numpnts($JDayStr)!=numpnts($wave2avgStr))<br />
Abort " The first two waves must have the same number of points."+JDayStr + " "+wave2avgStr+ " - Aborting from Macro"<br />
endif <br />
<br />
if (strlen(waveAvgStr)==0) <br />
Abort "You need to insert values into the name prompts - Aborting from Macro"<br />
endif<br />
<br />
waveAvgStr = CleanUpName(waveAvgStr, 0)<br />
Make/o/n=24 $waveAvgStr<br />
<br />
DoMakediurnal($JDayStr, $wave2avgStr, $waveAvgStr)<br />
<br />
Rename sdev $waveAvgStr + "_sdev"<br />
Display $waveAvgStr vs Hours<br />
ModifyGraph mode=4,marker=16<br />
Label left "Diurnal of " + NameofWave($wave2avgStr) + """insert units here???"""<br />
Label bottom "Hour of Day"<br />
ErrorBars $waveAvgStr Y,wave=($waveAvgStr + "_sdev",$waveAvgStr + "_sdev")<br />
<br />
End<br />
<br />
Function DoMakediurnal(JDay, wave2avg, waveAvg)<br />
Wave JDay, wave2avg, waveAvg<br />
<br />
Make/D/N=24 Hours=0<br />
Hours=Hours[p-1]+1<br />
<br />
Make/D/N=24 Day_Frac=Hours/24<br />
<br />
Duplicate JDay JDay_Frac<br />
JDay_Frac=JDay-floor(JDay)<br />
<br />
Wave Hours,Day_Frac,JDay_frac<br />
<br />
waveAvg=mean_bin(Jday_Frac,wave2avg,Day_Frac)<br />
End<br />
mean_bin is an averaging function that returns waveAvg and sdev. What I want is to make a "units" string(?, or maybe label?) defined by the user that will insert into the label.
Example:
February 6, 2014 at 12:24 pm - Permalink
February 12, 2014 at 03:58 pm - Permalink