3
$\begingroup$

I have a plot as below:-

Manipulate[Plot[Sin[x*t/40000], {x, -6.6, 6.6}], {t, 30000, 40000, Appearance -> "Labeled"}]

enter image description here

The t is in fact the number of days from Jan. 1, 1900. For example, the input DateObject[{1900, 1, 1}] + Quantity[35000, "Days"] would give me DateObject[{1995, 10, 30}, "Day", "Gregorian", -4.] as output.

How can I change the code such that the label inside the red circle become the date, instead of just the value of t?

Many thanks!

$\endgroup$
0
4
$\begingroup$
Manipulate[Plot[Sin[x*t/40000], {x, -6.6, 6.6}],
 {t, 30000, 40000, Labeled[Manipulator[##], 
    DateObject[{1900, 1, 1}] + Quantity[t, "Days"] , Right] &}]

or

Manipulate[Plot[Sin[x*t/40000], {x, -6.6, 6.6}], 
 Row[{Control@{t, 30000, 40000}, 
   Dynamic[DateObject[{1900, 1, 1}] + Quantity[t, "Days"]]}]]

enter image description here

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.