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

  • 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.


>>> 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='upper', interpolation='nearest', despine=False)#

Set deaults for plotting images

  • 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 “upper”.

  • 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.


>>> 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', width_fraction=0.025, height_fraction=None, 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 ppinard/matplotlib-scalebar for more information on additional 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”.

  • width_fraction (float, optional) – By default 0.025.

  • height_fraction (float, optional) – Deprecated - use width_fraction instead.

  • 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.


>>> import seaborn_image as isns
>>> isns.set_scalebar(color = "red")
>>> isns.set_scalebar(scale_loc = "bottom")

Set dpi for saving figures to disk


dpi (int, optional) – Image dpi for saving, by default 300.


>>> import seaborn_image as isns
>>> isns.set_save_context(dpi=200)

Reset rcParams to matplotlib defaults


>>> import seaborn_image as isns
>>> isns.reset_defaults()