4
$\begingroup$

Imagine I have the following code

Graphics[{LightBlue, Rectangle[], Black, Text["Hello", {.1, .9}]}]

enter image description here

If I had more text to the Text object I get, for example

Graphics[{LightBlue, Rectangle[], Black, Text["Hello, my name is Sam", {.1, .9}]}]

enter image description here

But I would like the text to keep writing on the right of the first "anchor point". That is, something like

enter image description here

How can I do this? Maybe there is a way of fixing the Text coordinates to be on the left?

$\endgroup$
2
  • 5
    $\begingroup$ Use 3rd argument of Text: Text["Hello, my name is Sam", {.1, .9}, {-1, 0}] $\endgroup$
    – Carl Woll
    Oct 20 at 18:25
  • 2
    $\begingroup$ Framed[Text[Style["This is my text", TextAlignment -> Left]], Background -> LightBlue] $\endgroup$ Oct 20 at 18:29
7
$\begingroup$
Framed[
   Text[
   Style["This is my text", TextAlignment -> Left]], 
 Background -> LightBlue,
 ImageSize -> {500, 100}]
$\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.