Is there a way to plot a title on two lines instead of one? I.e. Something like a title and a subtitle. I have some long titles that I would like to break onto a newline, but using \n doesn’t seem to work:
This comes up from time to time; perhaps time to make it a feature request, @weiji14? It should not be too hard to implement: Count the \n, then break into line with last line going where current single-line titles goes and work upwards with some sense of line-spacing derived from font size.
I’m trying to do something similar to this where I have a title and I want a subtitle that is of the data of an earthquake. I tried the gmt text approach (using classic mode) echo $ename | gmt pstext -J$proj -R$LONMIN/$LONMAX/$LATMIN/$LATMAX \ -F+f32p,Times-Roman+cCT -D0c/0.6c -N -K -O >> $psfile
This is an iterative loop for multiple events so I need some dynamic variables. The problem I’m having is this is plotting the text just outside the framed boarder and I want the text just inside the actual map. I can migrate this text inside the map if I have to with Illustrator but there are a ton of events to do so any way I can reduce the amount of post processing fixes, the better. Here is an example of what it looks like from this line of code. As you can see, it interferes with the map tic marks. Any advice on how to improve this is appreciated.
Thanks for pointing that out. I didn’t think to play with the -D flag. I set the -D flag to -D0c/-1.0c for negative displacement and that worked great.
Did this finally get settled? I read the github feature request and tried some of the ideas thrown around, there, but without success, using the latest GMT version.
I just want to be able to send a newline to (classic) pstext (not looking to do a plot title). Something like this:
Sheesh. I must be dense. I’m still not getting this. Trying:
printf "%f %f %s\n%s\n" 2.5 3.5 first second | gmt pstext -JX11i/8.5i -R0/11/0/8.5 -F+f12,1+jML -X-1i -Y-1i > $OUTMAP
pstext [WARNING]: Mismatch between actual (1) and expected (2) fields near line 2 in file <Standard Input>
Resulting in a page with only the word “first” on it.
I tried it with and without -M. Couldn’t succeed… my variations on a theme:
printf "%f %f %s\n%s\n" 2.5 3.5 first second | gmt pstext -JX11i/8.5i -R0/11/0/8.5 -M -F+f12,1+jML -X-1i -Y-1i > $OUTMAP
pstext [ERROR]: Text record line 0 not preceded by paragraph information, skipped)
pstext [ERROR]: Text record line 0 not preceded by paragraph information, skipped)
printf "> %f %f %s\n%s\n" 2.5 3.5 first second | gmt pstext -JX11i/8.5i -R0/11/0/8.5 -M -F+f12,1+jML -X-1i -Y-1i > $OUTMAP
pstext [WARNING]: Horizontal text justification not set, defaults to L(eft)
pstext [WARNING]: Length <unit> t not supported - revert to default unit [cm]
pstext [WARNING]: firs not a valid number and may not be decoded properly.
pstext [WARNING]: not a valid number and may not be decoded properly.
pstext [ERROR]: Record 0 had incomplete paragraph information, skipped)
pstext [ERROR]: Text record line 0 not preceded by paragraph information, skipped)
Please illustrate how this works. Not clear enough…
Just carefully read the pstext +M documentation, e.g.
Paragraph mode. Files must be multiple segment files. Segments are separated by a special record whose first character must be *flag* [Default is **>** ]
Sorry, Paul. Prefacing with “>” was exactly what I tried in my second variation on a theme, above. Received four warning messages and two error messages. Could you try it yourself and tell me whether it works for you? Just cut and paste:
printf "> %f %f %s\n%s\n" 2.5 3.5 first second | gmt pstext -JX11i/8.5i -R0/11/0/8.5 -M -F+f12,1+jML -X-1i -Y-1i > t.ps
I’m aiming to get the words “first” and “second” to be left justified with the word “first” positioned above the word “second.” This is all just to learn how this can be done.
I’m trying to write a multiline title for my legend but without success. Could anyone help?
Below is my initial approach. I’d like the “from average [@.C]” to be written below “temperature deviation” and centred. I’ve tried /n,/r,@^ within the “…”, but they didn’t work.
gmt psscale -C${temperature_cpt} -R -J -DjRB+w6c/0.5ch+e+o0/-1 -Ba750f187:“Temperature deviation from average [@.C]”: -O >> $psfile
Sorry nobody responded on this. There is no breaking a title into two lines, but there is a subtitle option for plot titles (see +s and +t). But your colon syntax is GMT 4 so that is not good to mix with modern syntax.