plot_func module

plot_func.closefig()
plot_func.closegraph()
plot_func.get_color(v, v_minmax=None, colorscale=’jet’, return_r=False)
class plot_func.legendScale(data=None, n=None, scale_type=’linear’, perc_bnd=[0, 100], colorscale=’jet’)

Bases: dict

Methods

copy()
getBoundaries()
getCmap()
getColorscale()
getFrm()
getImodLabels()
getLabels()
getRgba()
getTicks()
make_figure(labels=False)
putBoundaries(boundaries)
putImodLabels(imodlabels)
putLabels(labels)
putRgba(rgba)
putTicks(ticks)
setBoundaries(data, n=None, scale_type=’linear’, perc_bnd=[0, 100])

Method to set suitable boundary values (intervals) for classification of the data.

The boundaries may be used for classification into legends (colour scales), histogram bins etc.

Parameters:

data : numpy array (ndarray or MaskedArray) or array_like

The data to base the boundaries on. Masked values will not be included in the determination of the boundaries.

n : int or None (optional)

Number of intervals. This is an initial number; the final number of intervals may differ depending on the determined interval width.

If n is None then the initial number of intervals will be 8.

scale_type : str (optional)

Two types are supported: ‘linear’ and ‘histogram’.

If scale_type is ‘linear’ then the intervals will have equal widths.

If scale_type is ‘histogram’ then the interval widths will be based on the distribution of values (percentiles).

perc_bnd : numpy array or array_like (optional)

Lower and upper percentiles to be used as initial minimum and maximum boundary values.

Returns:

boundaries : numpy ndarray

Boundaries values.

frm : str

String format (% format) to format the boundaries values.

setImodLabels()
setLabels()
setLegend(colorscale=None, alfa=1)
setOver(rgba=None)
setTicks()
setUnder(rgba=None)
write_imod_leg(f_leg)
plot_func.read_imod_leg(f_leg)