I have a TimeSeries object in which the data is boolean (True,False) values. When I plot it using DateListPlot the result is blank.

elevations = Normal[GeoElevationData[geoPoints]]

*( {Quantity[3776.25, "Feet"], Quantity[3746.72, "Feet"], 
 Quantity[3877.95, "Feet"], Quantity[4685.04, "Feet"], 
 Quantity[4763.78, "Feet"], Quantity[4944.23, "Feet"], 
 Quantity[5085.3, "Feet"], Quantity[5511.81, "Feet"], 
 Quantity[5580.71, "Feet"], Quantity[5771., "Feet"], 
 Quantity[6354.99, "Feet"], Quantity[6696.19, "Feet"], 
 Quantity[7132.55, "Feet"], Quantity[6758.53, "Feet"], 
 Quantity[6479.66, "Feet"], Quantity[6387.8, "Feet"], 
 Quantity[6725.72, "Feet"]} *)

altitudeProfile = 
  Join[Table[elevations[[1]], {45}], Table[elevations[[4]], {120}], 
   Table[elevations[[7]], {105}], Table[elevations[[12]], {40}], 
   Table[elevations[[17]], {363 - 40 - 105 - 120 - 45}]];

isMoving = 
  Join[Table[False, {40}], Table[True, {5}], Table[False, {111}], 
   Table[True, {9}], Table[False, {102}], Table[True, {3}], 
   Table[False, {37}], Table[True, {3}], 
   Table[False, {363 - 40 - 105 - 120 - 45}]];

tsAltitudeProfile = 
   altitudeProfile, {Map[DateObject, Map[ToString, dataDate]]}];

tsIsMoving = 
  TimeSeries[isMoving, {Map[DateObject, Map[ToString, dataDate]]}];

DateListPlot[{tsAltitudeProfile, tsIsMoving}]

enter image description here

In this example, some researchers are encamped in a mountainous area over the course of a year and they move camp several times. There are two data series: altitude and whether they are moving or not (True/False). I would like to show the times when they are moving as a vertical band of color or something like that, but when I use DateListPlot it only shows the altitude data, not the IsMoving data.

  • $\begingroup$ How are True and False supposed to be represented as points? Maybe use Boole[] if you want the conventional mapping to 0/1? $\endgroup$ – J. M. will be back soon Dec 14 '16 at 2:40
  • $\begingroup$ @J.M. As I said in my question, ideally I would like the times when the researchers are moving camp to be represented as a vertical bar of color in the plot. It just has to be clear to the viewer when they are stationary and when they are moving. $\endgroup$ – Tyler Durden Dec 14 '16 at 2:45
  • $\begingroup$ what is dataDate? $\endgroup$ – M. Stern Nov 5 '17 at 0:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.