Retrieves the NDC bounding box values for the given object.
Available in version 1.3.1 or later.
top,bottom,left,right = Ngl.get_bounding_box(plotid)
Four scalars representing, in NDC space, the topmost, bottommost, leftmost, and rightmost edges of the given plot's space.
This function returns the bounding box values that enclose the given plot object. The bounding box is different than the viewport resources vpXF, vpYF, vpWidthF, vpHeightF, as it includes the area around the titles, tickmarks, tickmark labels, labelbar, etc.
The first argument is a PlotId and the second argument is the resource whose value you want to retrieve.
. . . plot = Ngl.contour(wks,data,cnres) bb = Ngl.get_bounding_box(plot) ; top, bottom, left, right . . .See viewport1.py (output) in the gallery.