PyNGL Home > Functions > Graphics routines


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)



The identifier returned from Ngl.open_wks, or any PyNGL function that returns a PlotId.

Return values

top, bottom, left, right

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.

See Also

View resources


. . .
plot = Ngl.contour(wks,data,cnres)
bb   = Ngl.get_bounding_box(plot)    ; top, bottom, left, right
. . .
See (output) in the gallery.