Ngl.add_annotation
Adds an annotation to a given plot.
Prototype
anno = Ngl.add_annotation(base_id, annotation_id, res=None)
Arguments
base_idThe PlotId of the plot of which you want to add the annotation.
annotation_idThe PlotId of the annotation you want to attach to the plot.
res=NoneAn (optional) instance of the Resources class having annotation resources as attributes.
Return value
annoAn integer id that represents the annotation added.
Description
This function adds an annotation to a base plot. An annotation can be any drawable object, like a labelbar, a text string, or another plot. Once you add an annotation, it becomes part of the base plot, and will automatically get drawn whenever the base plot is drawn. Annotation resources can be set via the res variable.
This function takes three arguments. The first is a PlotId for the base plot that you want to add the annotation to. This PlotId is usually one returned from a call to a plotting function like Ngl.xy, Ngl.vector, Ngl.contour_map, etc. The second argument is the PlotId of the annotation you want to add. This is usually one returned from a function like Ngl.labelbar_ndc, Ngl.legend_ndc, Ngl.text_ndc, etc. The optional third argument allows you to set some resources to control how the annotation behaves if the base plot is resized or moved.
Note that if you call this function multiple times, you should use a unique variable to hold the id returned. This id is useful if you want to remove the annotation later with a call to Ngl.remove_annotation.
See Also
Examples
See multi_y.py.