を見つけることができる最良の答えはここにポリゴンにマッピングされるテクスチャにテキストを変換し、代替的なアプローチです。これは、地域に合わせてテキストを延伸する機能がある
Show[Plot[x, {x, 0, 1}],
Graphics[{EdgeForm[Thick], Yellow, Rectangle[{.1, .5}, {.4, .9}]}],
Graphics[{Texture[ImageData[
Rasterize[Style["123", Red, Bold], "Image", RasterSize -> 300,
Background -> None]]],
Polygon[{{0.1, 0.5}, {0.4, 0.5}, {0.4, 0.9}, {0.1, 0.9}},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]}]]
の比較を容易にするための機能として(それは本当にもうテキストではないですので、を。):
(* Render string/style s to fill a rectangle with left/bottom corner {l,b} and
right/top corner {r,t}. *)
textrect[s_, {{l_,b_},{r_,t_}}] := Graphics[{
Texture[ImageData[Rasterize[s, "Image", RasterSize->300, Background->None]]],
Polygon[{{l,b}, {r,b}, {r,t}, {l,t}},
VertexTextureCoordinates->{{0,0},{1,0},{1,1},{0,1}}]}]
ニースアプローチ。ところで、{Scaled [1]、Scaled [1]}の代わりにScaled [1]を使用すると、テキストは垂直に配置されます。 – DavidC
@Davidありがとうございます。私はあなたの提案を試みたが、それは私のシステムでは機能しません。 : -/ –
ペインオプションAlignment - > Centerを追加すると、テキストが中央に配置されます。 –