Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: algorithm help -- how to label a clock

by toro (Beadle)
on Jun 17, 2011 at 07:15 UTC ( [id://910079]=note: print w/replies, xml ) Need Help??


in reply to algorithm help -- how to label a clock

I'm not sure I understand your question. It sounds like you know how to calculate the angle of where the text will be placed.

If that's the case, then divide the clock into four uneven parts: T = (−20deg, 20deg), R = (20deg, 160deg), B = (160deg, 200deg), L = (200deg, 340deg). If the text is in T or B, calculate the height of the text, and place the text above/below the circle by that height + margin. If the text is in L, then calculate the length of the text and start the text len($string)+$margin to the left of the angle you want to place it at. If the text is in R, then start the text $margin to the right of the circle.

You might also find a good answer in the R source code for plot.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://910079]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 03:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found