Question: How to format a title?

This apparently simple issue has stymied me. I want to produce a precisely formatted title for a plot, such as

    θ1 = 1.000     θ2 = 0.123     θ3 = 3.333

Each of the three values is between 0 and 5, and is displayed with one digit before the decimal point and three digits after. The actual calculations are done with the default Digits := 10.

I attempted something like:

    t := sin(1);     # just for illustration
    cat(θ__1, sprintf("=%5.3f", t));

but that produces θ1=0.841 rather than θ1=0.841. How can that be fixed?

The reason for my asking is that I wish to produce an animation, where the values of θ1, etc., change with each frame. I want to avoid annoying jitter by formatting the title string precisely.

Please Wait...