by jpatokal · 12y ago · 0 comments
GeoGraphics[Text[Style["Hello!", 150]], GeoRange -> World]
In any other language, if I wanted to write some text on a graphic, I would find a routine to load an image into memory and another to render text into that memory. That's genuinely easy.
But in Wolfram's case, I'm apparently just supposed to know that there's something called "GeoGraphics" that does this kind of thing, that the text goes in a Style[] block (what?), and "GeoRange -> World" is how you tell it to create a worldmap as a background. WTF. And don't tell me "read the docs", because even if I found this, it wouldn't help me much with the rest:
img = Import["c:/blah/blah.jpg"];
ImageCompose[img, Rasterize["HELLO"]]
That's the same Import you'd use if you wanted to read a webpage through a URL, etc.You're right that it might not be obvious what to search for, but in this case you would search for "image" or "importing" or "overlaying" and you'd figure it out.
Mathematica uses a 'compositional' model like some other functional languages, as opposed to a 'memory' model like system languages, so that could take some getting used to if your background is system languages.
"Hello World"
or even:
Hello World
which are both quines. The only reason you need to know about Style and GeoGraphics is for making a prettier, but still small, Hello World example.