Skip to main content
Ctrl+K
mpl_bsic 1.3.0 documentation - Home

Site Navigation

  • mpl_bsic.apply_bsic_style
  • mpl_bsic.apply_bsic_logo
    • mpl_bsic.plot_trade
    • mpl_bsic.export_figure
    • mpl_bsic.check_figsize
    • mpl_bsic.format_timeseries_axis
    • mpl_bsic.preprocess_dataframe
    • mpl_bsic.df_to_excel
    • mpl_bsic.style_excel_file

Site Navigation

  • mpl_bsic.apply_bsic_style
  • mpl_bsic.apply_bsic_logo
    • mpl_bsic.plot_trade
    • mpl_bsic.export_figure
    • mpl_bsic.check_figsize
    • mpl_bsic.format_timeseries_axis
    • mpl_bsic.preprocess_dataframe
    • mpl_bsic.df_to_excel
    • mpl_bsic.style_excel_file
  • mpl_bsic.app...

mpl_bsic.apply_bsic_logo#

mpl_bsic.apply_bsic_logo(fig, ax, scale=0.03, location='top left', logo_type='formal', alpha=1, closeness_to_border=50)[source]#

Apply the BSIC Logo to the Plot.

You can specify the scale, location, type, alpha, and how close the logo is to the border. Since the optimal values for these parameters will value from plot to plot, the suggestion is to tweak them until you find the right values for your plot. Choose the location so that the plot and logo overlap as little as possible.

Parameters:
figmatplotlib.figure.Figure

The Figure instance from matplotlib.

axmatplotlib.axes.Axes

The Axes instance from matplotlib.

scalefloat, optional

How much to scale the image, by default 0.03.

locationLocation, optional

The location to use for the logo, by default “top left”. Can be “top left”, “top right”, “bottom left”, “bottom right”.

logo_typeLiteral[“formal”, “square”], optional

Specify the logo to use, by default “formal”. The Formal logo is the extended one, the Square logo includes only the square.

alphafloat, optional

The alpha to use for the image (if you want transparency), by default 1.

closeness_to_borderfloat, optional

How close the logo should be to the border. A larger value means the logo will be closer to the border, by default 50.

See also

mpl_bsic.apply_bsic_style

Applies the BSIC Style to plots.

Examples

from mpl_bsic import apply_bsic_style, apply_bsic_logo

import matplotlib.pyplot as plt

x = np.linspace(0, 5, 100)
y = np.cos(x)

fig, ax = plt.subplots(1, 1)
ax.set_title('Cos(x)') # set the title before applying the style
apply_bsic_style(fig, ax)
apply_bsic_logo(fig, ax, location='top right', scale=0.03)

ax.plot(x,y)
run_animations(fig) # only needed for the docs, don't call in the actual code

(Source code, png, pdf)

example plot using apply_bsic_logo() (top right, formal logo)
from mpl_bsic import apply_bsic_style, apply_bsic_logo

import matplotlib.pyplot as plt

x = np.linspace(0, 5, 100)
y = np.cos(x)

fig, ax = plt.subplots(1, 1)
ax.set_title('Cos(x)') # set the title before applying the style
apply_bsic_style(fig, ax)
apply_bsic_logo(
    fig,
    ax,
    location='bottom left',
    scale=0.05,
    logo_type='square', # use the square logo
    closeness_to_border=25 # make the logo closer to the border
)

ax.plot(x,y)
run_animations(fig) # only needed for the docs, don't call in the actual code

(Source code, png, pdf)

example plot using apply_bsic_logo() (btm left, square logo)

previous

mpl_bsic.apply_bsic_style

next

mpl_bsic.plot_trade

On this page
  • apply_bsic_logo()
Show Source

© Copyright 2023, Andrea Franceschini.

Created using Sphinx 7.3.7.

Built with the PyData Sphinx Theme 0.14.3.