How can I wrap text around a circle?
For example: the text in the sectors of this chord plot.
Perhaps one could use FilledCurve[] and then apply a GeometricTransformation[]?
|
How can I wrap text around a circle? For example: the text in the sectors of this chord plot. Perhaps one could use |
|||||
|
|
The following response borrows shamelessly from Mr.Wizard:
Note: "Arc length" is based on the unit circle. $2 \pi$, or approximately 6.28 corresponds to a $360^\circ$ arc on the unit circle. The actual full arc length will be $2\pi r$. |
|||||||
|
|
This places a string on the outside of a unit circle. It works for variable width fonts.
Here, Example
Edit I've adapted the code. You can now specify an arc along which you want to place the text, for example
|
||||
|
Here is a starting point:
|
|||||||
|
|
Here's an approach that works alright with both fixed width and proportional fonts, and gives you some flexibility when it comes to the style of the text. It uses the common, hacky trick of rasterizing the text beforehand to work out the approximate sizes of the letters, and it uses the
The frames are magic pink to make them even easier to pick out. Then all that remains is to draw the text on the circle. I use the relative sizes of the letters to work out the angles, and use
EDIT because this answer is useless without pics!
|
|||
|
|
|
Modifying an example from the help on FilledCurve[]:
|
||||
|