Global Settings¶
-
seaborn_image.
set_context
(mode='paper', fontfamily='sans-serif', fontweight='normal', rc=None)¶ Set context for images with mode, fontfamily and fontweight. Additional, rc params can also be passed as dict
- Parameters
mode (str, optional) – Plotting context mode. Depending on the context, axes width, fontsize, layout etc. are scaled. Options are ‘paper’, ‘notebook’, ‘presentation’, ‘talk’ and ‘poster’, by default “paper”.
fontfamily (str, optional) – Font-family to use, by default “sans-serif”.
fontweight (str, optional) – Font-weight to use. Options include ‘normal’ and ‘bold’, by default “bold”.
rc (dict, optional) – Additional matplotlib.rcParams to be passed to matplotlib, by default None.
Examples
>>> import seaborn_image as isns >>> isns.set_context(mode="poster", fontfamily="sans-serif") >>> isns.set_context(rc={"axes.edgecolor": "red"})
-
seaborn_image.
set_image
(cmap='deep', origin='lower', interpolation='nearest', despine=False)¶ Set deaults for plotting images
- Parameters
cmap (str, optional) – Colormap to use accross images, by default to “deep”.
origin (str, optional) – Image origin - same as in matplotlib.pyplot.imshow, by default “lower”.
interpolation (str, optional) – Image interpolation - same as in matplotlib.pyplot.imshow, by default “nearest”.
despine (bool, optional) – Despine image and colorbar axes, by default False.
Examples
>>> import seaborn_image as isns >>> isns.set_image(cmap="inferno", interpolation="bicubic") >>> isns.set_image(despine=False)
-
seaborn_image.
set_scalebar
(color='white', location='lower right', height_fraction=0.025, length_fraction=0.3, scale_loc='top', box_alpha=0, rc=None)¶ Set scalebar properties such as color, scale_loc, height_fraction, length_fraction, box_alpha, etc. To pass more properties that are not specified as key word argument, use the rc parameter. Refer to https://github.com/ppinard/matplotlib-scalebar for more information on additional parameters.
- Parameters
color (str, optional) – Color of the scalebar, by default “white”.
location (str, optional) – Scalebar location on the image (same as matplotlib legend). by default “lower right”.
height_fraction (float, optional) – By default 0.025.
length_fraction (float, optional) – By default 0.3
scale_loc (str, optional) – Location of the scale number and units with respect to the bar, by default “top”.
box_alpha (float, optional) – Transparency of the box that contains the scalebar artist, by default 0.
rc (dict, optional) – Dictionary of scalebar properties to be set, by default None.
Examples
>>> import seaborn_image as isns >>> isns.set_scalebar(color = "red") >>> isns.set_scalebar(scale_loc = "bottom")
-
seaborn_image.
set_save_context
(dpi=300)¶ Set dpi for saving figures to disk
- Parameters
dpi (int, optional) – Image dpi for saving, by default 300.
Examples
>>> import seaborn_image as isns >>> isns.set_save_context(dpi=200)
-
seaborn_image.
reset_defaults
()¶ Reset rcParams to matplotlib defaults
Examples
>>> import seaborn_image as isns >>> isns.reset_defaults()