mosaic.contour.MPASContourSet#
- class mosaic.contour.MPASContourSet(ax, *args, levels=None, filled=False, linewidths=None, linestyles=None, hatches=(None,), alpha=None, origin=None, extent=None, cmap=None, colors=None, norm=None, vmin=None, vmax=None, colorizer=None, extend='neither', antialiased=None, nchunk=0, locator=None, transform=None, negative_linestyles=None, clip_path=None, **kwargs)#
A
matplotlib.contour.ContourSetsubclass for MPAS meshes.This contour set is created by
mosaic.contour()andmosaic.contourf()to draw contour lines and filled contours on an unstructured MPAS mesh.Compared to
matplotlib.contour.ContourSet, the first positional argument is expected to be aDescriptordescribing the MPAS mesh, and the contour generator is provided byMPASContourGenerator.Users normally do not instantiate this class directly; instead, call
mosaic.contour()ormosaic.contourf().- __init__(ax, *args, levels=None, filled=False, linewidths=None, linestyles=None, hatches=(None,), alpha=None, origin=None, extent=None, cmap=None, colors=None, norm=None, vmin=None, vmax=None, colorizer=None, extend='neither', antialiased=None, nchunk=0, locator=None, transform=None, negative_linestyles=None, clip_path=None, **kwargs)#
Draw contour lines or filled regions, depending on whether keyword arg filled is
False(default) orTrue.Call signature:
ContourSet(ax, levels, allsegs, [allkinds], **kwargs)
- Parameters:
ax (~matplotlib.axes.Axes) – The ~.axes.Axes object to draw on.
levels (
[level0,level1,...,leveln]) – A list of floating point numbers indicating the contour levels.allsegs (
[level0segs,level1segs,]) – List of all the polygon segments for all the levels. For contour lineslen(allsegs) == len(levels), and for filled contour regionslen(allsegs) = len(levels)-1. The lists should look likelevel0segs = [polygon0, polygon1, ...] polygon0 = [[x0, y0], [x1, y1], ...]
allkinds (
[level0kinds,level1kinds,], optional) – Optional list of all the polygon vertex kinds (code types), as described and used in Path. This is used to allow multiply- connected paths such as holes within filled polygons. If notNone,len(allkinds) == len(allsegs). The lists should look likelevel0kinds = [polygon0kinds, ...] polygon0kinds = [vertexcode0, vertexcode1, ...]
If allkinds is not
None, usually all polygons for a particular contour level are grouped together so thatlevel0segs = [polygon0]andlevel0kinds = [polygon0kinds].**kwargs – Keyword arguments are as described in the docstring of ~.Axes.contour.
Methods
__init__(ax, *args[, levels, filled, ...])Draw contour lines or filled regions, depending on whether keyword arg filled is
False(default) orTrue.add_callback(func)Add a callback function that will be called whenever one of the .Artist's properties changes.
add_label(x, y, rotation, lev, cvalue)Add a contour label, respecting whether use_clabeltext was set.
add_label_near(x, y[, inline, ...])Add a label near the point
(x, y).autoscale()Autoscale the scalar limits on the norm instance using the current array
autoscale_None()Autoscale the scalar limits on the norm instance using the current array, changing only limits that are None
changed()Call this whenever the mappable is changed to notify all the callbackSM listeners to the 'changed' signal.
clabel([levels, fontsize, inline, ...])Label a contour plot.
contains(mouseevent)Test whether the mouse event occurred in the collection.
convert_xunits(x)Convert x using the unit type of the xaxis.
convert_yunits(y)Convert y using the unit type of the yaxis.
draw(renderer)Draw the Artist (and its children) using the given renderer.
find_nearest_contour(x, y[, indices, pixel])Find the point in the contour plot that is closest to
(x, y).findobj([match, include_self])Find artist objects.
format_cursor_data(data)Return a string representation of data.
get_aa()Alias for get_antialiased.
get_agg_filter()Return filter function to be used for agg filter.
get_alpha()Return the alpha value used for blending - not supported on all backends.
get_animated()Return whether the artist is animated.
get_antialiased()Get the antialiasing state for rendering.
get_antialiaseds()Alias for get_antialiased.
get_array()Return the array of values, that are mapped to colors.
get_capstyle()Return the cap style for the collection (for all its elements).
get_children()Return a list of the child .Artists of this .Artist.
get_clim()Return the values (min, max) that are mapped to the colormap limits.
get_clip_box()Return the clipbox.
get_clip_on()Return whether the artist uses clipping.
get_clip_path()Return the clip path.
get_cmap()Return the .Colormap instance.
get_cursor_data(event)Return the cursor data for a given event.
get_dashes()Alias for get_linestyle.
get_datalim(transData)get_ec()Alias for get_edgecolor.
get_edgecolor()get_edgecolors()Alias for get_edgecolor.
get_facecolor()get_facecolors()Alias for get_facecolor.
get_fc()Alias for get_facecolor.
get_figure([root])Return the .Figure or .SubFigure instance the artist belongs to.
get_fill()Return whether face is colored.
get_gid()Return the group id.
get_hatch()Return the current hatching pattern.
get_hatch_linewidth()Return the hatch linewidth.
get_in_layout()Return boolean flag,
Trueif artist is included in layout calculations.get_joinstyle()Return the join style for the collection (for all its elements).
get_label()Return the label used for this artist in the legend.
get_linestyle()get_linestyles()Alias for get_linestyle.
get_linewidth()get_linewidths()Alias for get_linewidth.
get_ls()Alias for get_linestyle.
get_lw()Alias for get_linewidth.
get_mouseover()Return whether this artist is queried for custom context information when the mouse cursor moves over it.
get_offset_transform()Return the .Transform instance used by this artist offset.
get_offsets()Return the offsets for the collection.
get_path_effects()get_paths()get_picker()Return the picking behavior of the artist.
get_pickradius()get_rasterized()Return whether the artist is to be rasterized.
get_sketch_params()Return the sketch parameters for the artist.
get_snap()Return the snap setting.
get_text(lev, fmt)Get the text of the label.
get_tightbbox([renderer])Like .Artist.get_window_extent, but includes any clipping.
get_transOffset()Alias for get_offset_transform.
get_transform()Return the .Transform instance used by this ContourSet.
get_transformed_clip_path_and_affine()Return the clip path with the non-affine part of its transformation applied, and the remaining affine part of its transformation.
get_transforms()get_url()Return the url.
get_urls()Return a list of URLs, one for each element of the collection.
get_visible()Return the visibility.
get_window_extent([renderer])Get the artist's bounding box in display space.
get_zorder()Return the artist's zorder.
have_units()Return whether units are set on any axis.
is_transform_set()Return whether the Artist has an explicitly set transform.
labels(inline, inline_spacing)legend_elements([variable_name, str_format])Return a list of artists and labels suitable for passing through to ~.Axes.legend which represent this ContourSet.
locate_label(linecontour, labelwidth)Find good place to draw a label (relatively flat part of the contour).
pchanged()Call all of the registered callbacks.
pick(mouseevent)Process a pick event.
pickable()Return whether the artist is pickable.
pop_label([index])Defaults to removing last label, but any index can be supplied
print_label(linecontour, labelwidth)Return whether a contour is long enough to hold a label.
properties()Return a dictionary of all the properties of the artist.
remove()Remove the artist from the figure if possible.
remove_callback(oid)Remove a callback based on its observer id.
set(*[, agg_filter, alpha, animated, ...])Set multiple properties at once.
set_aa(aa)Alias for set_antialiased.
set_agg_filter(filter_func)Set the agg filter.
set_alpha(alpha)Set the alpha value used for blending - not supported on all backends.
set_animated(b)Set whether the artist is intended to be used in an animation.
set_antialiased(aa)Set the antialiasing state for rendering.
set_antialiaseds(aa)Alias for set_antialiased.
set_array(A)Set the value array from array-like A.
set_capstyle(cs)Set the .CapStyle for the collection (for all its elements).
set_clim([vmin, vmax])Set the norm limits for image scaling.
set_clip_box(clipbox)Set the artist's clip .Bbox.
set_clip_on(b)Set whether the artist uses clipping.
set_clip_path(path[, transform])Set the artist's clip path.
set_cmap(cmap)Set the colormap for luminance data.
set_color(c)Set both the edgecolor and the facecolor.
set_dashes(ls)Alias for set_linestyle.
set_ec(c)Alias for set_edgecolor.
set_edgecolor(c)Set the edgecolor(s) of the collection.
set_edgecolors(c)Alias for set_edgecolor.
set_facecolor(c)Set the facecolor(s) of the collection.
set_facecolors(c)Alias for set_facecolor.
set_fc(c)Alias for set_facecolor.
set_figure(fig)Set the .Figure or .SubFigure instance the artist belongs to.
set_gid(gid)Set the (group) id for the artist.
set_hatch(hatch)Set the hatching pattern
set_hatch_linewidth(lw)Set the hatch linewidth.
set_in_layout(in_layout)Set if artist is to be included in layout calculations, E.g.
set_joinstyle(js)Set the .JoinStyle for the collection (for all its elements).
set_label(s)Set a label that will be displayed in the legend.
set_linestyle(ls)Set the linestyle(s) for the collection.
set_linestyles(ls)Alias for set_linestyle.
set_linewidth(lw)Set the linewidth(s) for the collection.
set_linewidths(lw)Alias for set_linewidth.
set_ls(ls)Alias for set_linestyle.
set_lw(lw)Alias for set_linewidth.
set_mouseover(mouseover)Set whether this artist is queried for custom context information when the mouse cursor moves over it.
set_norm(norm)Set the normalization instance.
set_offset_transform(offset_transform)Set the artist offset transform.
set_offsets(offsets)Set the offsets for the collection.
set_path_effects(path_effects)Set the path effects.
set_paths(paths)set_picker(picker)Define the picking behavior of the artist.
set_pickradius(pickradius)Set the pick radius used for containment tests.
set_rasterized(rasterized)Force rasterized (bitmap) drawing for vector graphics output.
set_sketch_params([scale, length, randomness])Set the sketch parameters.
set_snap(snap)Set the snapping behavior.
set_transOffset(offset_transform)Alias for set_offset_transform.
set_transform(t)Set the artist transform.
set_url(url)Set the url for the artist.
set_urls(urls)set_visible(b)Set the artist's visibility.
set_zorder(level)Set the zorder for the artist.
to_rgba(x[, alpha, bytes, norm])Return a normalized RGBA array corresponding to x.
too_close(x, y, lw)Return whether a label is already near this location.
update(props)Update this artist's properties from the dict props.
update_from(other)Copy properties from other to self.
update_scalarmappable()Update colors from the scalar mappable array, if any.
Attributes
allkindsallsegsalphaaxesThe ~.axes.Axes instance the artist resides in, or None.
cmapcolorbarThe last colorbar associated with this object.
colorizerfigureThe (Sub)Figure that the artist is on.
linestylesmouseoverReturn whether this artist is queried for custom context information when the mouse cursor moves over it.
normstaleWhether the artist is 'stale' and needs to be re-drawn for the output to match the internal state of the artist.
sticky_edgesxandysticky edge lists for autoscaling.zorder