This issue follows up on comments by @meghanrjones in #3344. In classic mode, PS_MEDIA is always used to set the paper size of the PostScript plot as the only supported graphics format. The default paper size is either A4 or US letter, but this is typically changed via PS_MEDIA for larger maps or specialized plots. This behavior is correct and has not nor will not change going forward.
However, for modern mode all the PostScript plotting is removed from the users direct control in several ways. For instance, the default graphics format is PDF, but users can specify a range of raster formats, EPS and PS. Apart from the pure PS choice, all other formats imply a limitless canvas (actually, limited to 11 x 11 meters), and then we crop the canvas do what was actually used. In this context, PS_MEDIA should have no purpose. A complication arises should a user request several graphics formats with one being PS, such as in
gmt begin map ps,png
gmt coast -Rg -JH180/15c -Gpink -B
gmt end show
Here there is a mix of plots that must be cropped (png) and one that has a specified paper size (whatever PS_MEDIA says). Since in reality we always make a PostScript file first, what should be behavior be in this case? Right now, both the PNG and PS plot actually have the size of the default paper size for PostScript [A4]. I think the correct behavior should be:
- Always plot using the infinite canvas
- For ps (PostScript output), crop this boundingbox to what PS_MEDIA says
- For other formats, crop to fit (as per PS_CONVERT settings)
However, I am not sure what a user imagine they want by asking for a PS. Say they ask for EPS instead. Well, setting eps,png yields a correctly cropped EPS file but still a page-sized PNG! I doubt that is what is expected, but who knows what goes on in the minds of users.
Seems to me we should enforce the rule above, making all PDF, EPS, and rasters cropped to the plot size, while PS output is cropped to the page size. Any guru who for whatever reason wants a PNG with exact page size can make the PS then run psconvert as needed. I cannot really see the need for this in modern mode.
Comments, @GenericMappingTools/core ?
This issue follows up on comments by @meghanrjones in #3344. In classic mode, PS_MEDIA is always used to set the paper size of the PostScript plot as the only supported graphics format. The default paper size is either A4 or US letter, but this is typically changed via PS_MEDIA for larger maps or specialized plots. This behavior is correct and has not nor will not change going forward.
However, for modern mode all the PostScript plotting is removed from the users direct control in several ways. For instance, the default graphics format is PDF, but users can specify a range of raster formats, EPS and PS. Apart from the pure PS choice, all other formats imply a limitless canvas (actually, limited to 11 x 11 meters), and then we crop the canvas do what was actually used. In this context, PS_MEDIA should have no purpose. A complication arises should a user request several graphics formats with one being PS, such as in
Here there is a mix of plots that must be cropped (png) and one that has a specified paper size (whatever PS_MEDIA says). Since in reality we always make a PostScript file first, what should be behavior be in this case? Right now, both the PNG and PS plot actually have the size of the default paper size for PostScript [A4]. I think the correct behavior should be:
However, I am not sure what a user imagine they want by asking for a PS. Say they ask for EPS instead. Well, setting eps,png yields a correctly cropped EPS file but still a page-sized PNG! I doubt that is what is expected, but who knows what goes on in the minds of users.
Seems to me we should enforce the rule above, making all PDF, EPS, and rasters cropped to the plot size, while PS output is cropped to the page size. Any guru who for whatever reason wants a PNG with exact page size can make the PS then run psconvert as needed. I cannot really see the need for this in modern mode.
Comments, @GenericMappingTools/core ?