All labels for longitude lines at bottom and latitude lines on left and right of the map look fine when viewed in JFrame like the one used in https://docs.geotools.org/latest/userguide/tutorial/raster/image.html
File saved using saveImage function in https://docs.geotools.org/latest/userguide/library/render/gtrenderer.html
Using mapContent.getMaxBounds() as envelope to create and save the image.
The green background filling of rectangle for Graphic2D image used to save in the file.
The same map seem to appear in both images attached, yet the labels at the bottom and on the right of the map (JFrame) are not included in the saved file.
How do I debug this issue?
I am not really familiar with this geographical representations although I am learning a bit.