plotnine.guide_colorbar

guide_colorbar(
    title=None,
    theme=Theme(),
    position=None,
    direction=None,
    reverse=False,
    order=0,
    nbin=None,
    display="gradient",
    alpha=None,
    draw_ulim=True,
    draw_llim=True
)

Guide colorbar

Parameter Attributes

title: Optional[str] = None

Title of the guide. Default is the name of the aesthetic or the name specified using lab

theme: Theme = field(default_factory=Theme)

A theme to style the guide. If None, the plots theme is used.

position: Optional[LegendPosition] = None

Where to place the guide relative to the panels.

direction: Optional[Orientation] = None

Direction of the guide. The default is depends on legend_position.

reverse: bool = False

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

order: int = 0

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

nbin: Optional[int] = None

Number of bins for drawing a colorbar. A larger value yields a smoother colorbar

display: Literal["gradient", "rectangles", "raster"] = "gradient"

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to ‘strict’.

alpha: Optional[float] = None

Opacity (in the range [0, 1]) of the colorbar. The defualt None, is to use the opacity of the plot.

draw_ulim: bool = True

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

draw_llim: bool = True

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

Notes

To correctly place a rasterized colorbar when saving the plot as an svg or pdf, you should set the dpi to 72 i.e. theme(dpi=72).