Re: -A ps2raster in gmt5.1.0

Remko Scharroo <[email protected]>
Newsgroups gmane.comp.gis.gmt.user
Message-ID <[email protected]>
Hi Gery,

What you’re seeing is not actually due to any change in ps2raster, but in the way GMT (no longer) keeps track of the bounding box in GMT5. I’ll explain within the text below, because your example is very illustrative (thank you!).
(I changed the -Y10 to -Y-10 as you indicated in your later mail)

On 18 Mar 2014, at 19:22, Gery . <[email protected]> wrote:

> Hello,
> 
> I noticed recently that using ps2raster in gmt5.1.0 gives something "new" than the 4.5.6 and 4.5.9 versions. In these old versions I generated my PNG/PDF for instance with:
> 
> pscoast ... something something ... -K > ps
> psxy ... something something ... -K -O >> ps
> psxy … something something ... -Y-10 -K -O >> ps
> psbasemap ... something something ... -O >> ps
> ps2raster -A -Tf ps

Note that you first plot starts near the corner in the bottom left, offset by one inch from the corner in both directions.
Then with your -Y-10 (whether it be centimeters or inches) your second psxy will drop below the bottom of the page.

In earlier GMT versions, GMT was trying to keep track of the BoundingBox of your printed material, but this was very much prone to error, so we decided to drop that process, and in stead just set a default BoundingBox as large as the size of your chosen paper (a2 in this case).

So in the past, GMT was “magically” able to give you negative BoundingBox coordinates, and with some luck ps2raster did not complain about that and pushed everything back in place. With the new implementation in GMT5, your material simply falls outside the BoundingBox and so gets lost in ps2raster.

> and both plots appeared as they should be (one on top and the other one below it with an adjusted BoundingBox even though I used a "bigger" map size such as PAPER_MEDIA a2+). In gmt5.1.0, I found that things should be:
> 
> pscoast ... something something ... -Y15 -K > ps           (so first pulling the top map UP)
> psxy ... something something ... -K -O >> ps
> psxy … something something ... -Y-10 -K -O >> ps
> psbasemap ... something something ... -O >> ps
> ps2raster -A -Tf ps

Indeed, that is exactly what you should have done in the first place :)
You start higher up on the page so that you can go lower with the second ps2raster and stay on your A2 paper.
Alternatively, you can start with the second plot and then move up to do the first.

> and the -A in ps2raster will depend on the PS_MEDIA I use (in gmt4.5.6/4.5.9 I have no problems with -A because I simply used a2+ and my PS had the BoundingBox adjusted automatically to the size of the plot no matter what I used, for instance, a0 which is bigger than a2 and a2+).

Yes, A0 would still not work, because you start with the first part of your plotting in the bottom left corner. When you go down with -Y-10 you draw outside your paper, no matter how big it is!

> By the way, it seems that a2+ is not recognized by gmt5.1.0 afaik.

Yes. Since we are no longer tracking the BoundingBox there is no distinction any more between PS and EPS.

> I read the ps2raster doc (http://gmt.soest.hawaii.edu/doc/5.1.0/ps2raster.html) and I understand that "ps2raster -A -Tf" should work the same in 4.5.6/4.5.9 and 5.1.0. Am I missing something obvious here or what I explained above for the 5.1.0 is how ps2raster works now?

As I said, it is not ps2raster that changed behaviour, but all the rest of GMT. Simply stop drawing outside the paper, and you’re all set!

Cheers,
Remko 

PS: Please note that GMT 5.1.1 is already out with a lot of bug fixes.

To unsubscribe, send the message "signoff gmt-help" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.