Hi,
I was expecting that -N should let me draw outside the box with psxy, but that does not seem to happen?
reg=-R-1/1/-1/1
proj=-JX5
ofile=tmp.ps
psbasemap $reg $proj -P -Ba.5f.05 -K > $ofile
cat <<EOF | psxy -m $reg $proj -O -N -W >>$ofile
Possible workaround: Size your plot large enough that your extension beyond the frame is plotted but without any frames. Overlay a basemap with all the frames and embellishments you want that is shorter in x direction. Now your line should extend beyond the frame.
This goes backs decades and how GMT deals with clipping polygons against map boundaries, which is not a trivial thing given periodicities in longitude etc. So since the Bush 1 administration the -N only applies to symbols which sets a clip path so that half-clipped symbols can bee seen at borders. Lines undergo a separate ritual where we compute intersections with boundaries and split lines into many segments or in the case of polygons add the missing segments along the border.
Yet, I also from time to time want to draw a polygon beyond the map border and it is painful to compute the required larger -R and scale and offsets to make it work. So I am working on a PR where -N will be acceptable with lines and polygons (not other lines like quoted lines and fronts which are hybrid things). It is assumed that the line is not wrapping around the Earth etc since there is no longer any checking: We simply convert the coordinates to plot coordinates and draw the line or polygon. So far it seems OK but I had to fix a few tests that incorrectly had a -N option in psxy calls for lines (which of course did nothing but now with my changes they do the wrong thing…).
Thanks so much, Paul, for the explanation and quick work to get this going! Like mentioned to @yvonnefroehlich, I thought this was working in GMT4, but must have made that up. Looks like your patch is great! Thanks again!
Thanks, Paul - works for the bounds, but now seems to have lost capability to pick up -W type instructions in the > headers?
reg=-R-1/1/-1/1
proj=-JX5
ofile=tmp.ps
psbasemap $reg $proj -P -Ba.5f.05 -K > $ofile
cat <<EOF | psxy -m $reg $proj -O -N >>$ofile