API

exception fivecentplots.fcp.EngineError(*args, **kwargs)
fivecentplots.fcp.axes()

Dummy function to return the axes API with help() (not used directly for plotting).

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y=['Voltage', 'I [A]'], legend=['Die', 'Substrate'],
             col='Boost Level', twin_x=True,
             share_y=False, share_y2=False, share_x=True,
             filter='Target Wavelength==450 & Temperature [C]==25',
             ax_edge_color='#FF0000', ax_edge_left=False, ax_edge_right=False, ax_edge_width=2,
             ax_fill_color='#96BEAA', ax_fill_alpha=0.5,
             ax_scale='logx', ax_size=[400, 300])
../_static/images/example_axes.png

Axes element is shown in olive green with red borders

fivecentplots.fcp.bar(df, **kwargs)

Bar chart.

Parameters

df (pandas.DataFrame) – DataFrame containing data to plot

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_bar.csv')
>>> fcp.bar(df, x='Liquid', y='pH', filter='Measurement=="A" & T [C]==25',
            tick_labels_major_x_rotation=90)
../_static/images/example_bar.png
fivecentplots.fcp.boxplot(df, **kwargs)

Box plot modeled after the “Variability Chart” in JMP which Dummy function to return convenient, multi-level group labels automatically along the x-axis.

Parameters

df (pandas.DataFrame) – DataFrame containing data to plot

Keyword Arguments
  • y (str) – y-axis column name contining the box plot data [REQUIRED]

  • BASIC

  • box_divider (bool) – Toggle box divider visibility. Defaults to True. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Dividers

  • box_divider_color (str) – Hex color string for the vertical line between groups. Defaults to #bbbbbb.

  • box_divider_style (str) – Line style for the box divider lines {‘-’, ‘–’, ‘-.’, ‘:’}. Defaults to -.

  • box_divider_width (float) – Width of the divider lines in pixels. Defaults to 1.

  • box_edge_color (str) – Hex color string for the edge of the box. Defaults to #aaaaaa. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/styles.html#Boxplot-example

  • box_edge_width (float) – Width of the edge of the boxes in pixels. Defaults to 0.5.

  • box_fill_color (str) – Hex color string of the bar fill . Defaults to #ffffff. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/styles.html#Boxplot-example

  • box_median_color (str) – Hex color string of the median line inside each box. Defaults to #ff7f0e.

  • box_on (bool) – Toggle box visibility. Defaults to True.

  • box_range_lines (bool) – Toggle the horizontal lines showing the min/max of the data range. Defaults to True. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Range-lines

  • box_range_lines_color (str) – Hex color string for the box range lines. Defaults to #cccccc.

  • box_range_lines_style (str) – Line style for the box range lines {‘-’, ‘–’, ‘-.’, ‘:’}. Defaults to –.

  • box_range_lines_width (float) – Width of the range lines in pixels. Defaults to 1.

  • box_whisker (bool) – Toggle range lines that extend from the box Q1/Q3 edges to the data min/max. Defaults to True. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Whiskers

  • box_whisker_color (str) – Hex color string for the box whisker lines. Defaults to #cccccc.

  • box_whisker_style (str) – Line style for the box whisker lines {‘-’, ‘–’, ‘-.’, ‘:’}. Defaults to -.

  • box_whisker_width (float) – Width of the whisker lines in pixels. Defaults to 0.5.

  • box_width (float) – Set the fractional width of the boxes between 0-1. Defaults to 0.5 [if violin on, 0.15].

  • groups (str|list) – Grouping columns for the box plot. Defaults to None. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Groups

  • notch (bool) – Use a notched-style box instead of a rectangular box. Defaults to False. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Notch

  • GROUPING_TEXT

  • box_group_label_edge_alpha (float) – Transparency value for group label line edge between 0-1. Defaults to 1.

  • box_group_label_edge_color (str) – Hex color string for the group label rectangle edge. Defaults to #ffffff.

  • box_group_label_edge_width (float) – Width of the edge of the line around the group labels in pixels. Defaults to 1.

  • box_group_label_fill_alpha (float) – Transparency value for group label fill between 0-1. Defaults to 1.

  • box_group_label_fill_color (str) – Hex color string for the group label background color. Defaults to #ffffff.

  • box_group_label_font (str) – Font name for box group label. Defaults to Sans-serif.

  • box_group_label_font_color (str) – Hex color string for group label font. Defaults to #000000.

  • box_group_label_font_size (float) – Font size for group label text in pixels. Defaults to 12.

  • box_group_label_font_style (str) – Font style for the group label text {‘normal’, ‘italic’, ‘oblique’}. Defaults to ‘normal’.

  • box_group_label_font_weight (str) – Font weight for the group label text {‘light’, ‘normal’, ‘medium’, ‘semibold’, ‘bold’, ‘heavy’, ‘black’}. Defaults to ‘normal’.

  • box_group_title_edge_alpha (float) – Transparency value for group title line edge between 0-1. Defaults to 1.

  • box_group_title_edge_color (str) – Hex color string for the group title rectangle edge. Defaults to #ffffff.

  • box_group_title_edge_width (float) – Width of the edge of the line around the group titles in pixels. Defaults to 1.

  • box_group_title_fill_alpha (float) – Transparency value for group title fill between 0-1. Defaults to 1.

  • box_group_title_fill_color (str) – Hex color string for the group title background color. Defaults to #ffffff.

  • box_group_title_font (str) – Font name for box group title. Defaults to Sans-serif.

  • box_group_title_font_color (str) – Hex color string for group title font. Defaults to #000000.

  • box_group_title_font_size (float) – Font size for group title text in pixels. Defaults to 13.

  • box_group_title_font_style (str) – Font style for the group title text {‘normal’, ‘italic’, ‘oblique’}. Defaults to ‘normal’.

  • box_group_title_font_weight (str) – Font weight for the group title text {‘light’, ‘normal’, ‘medium’, ‘semibold’, ‘bold’, ‘heavy’, ‘black’}. Defaults to ‘normal’.

  • STAT_LINES

  • box_grand_mean (bool) – Toggle visibility of a line showing the mean of all data on the plot. Defaults to False. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Grand-Mean/Median

  • box_grand_mean_color|grand_mean_color (str) – Hex color string for the grand mean line. Defaults to #555555.

  • box_grand_mean_style|grand_mean_style (str) – Line style for the box grand mean lines {‘-’, ‘–’, ‘-.’, ‘:’}. Defaults to ‘-’.

  • box_grand_mean_width|grand_mean_width (float) – Width of the grand mean line in pixels. Defaults to 1.

  • box_grand_median (bool) – Toggle visibility of a line showing the median of all data on the plot. Defaults to False. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Grand-Mean/Median

  • box_grand_median_color|grand_median_color (str) – Hex color string for the grand median line. Defaults to #0000ff.

  • box_grand_median_style|grand_median_style (str) – Line style for the box grand median lines {‘-’, ‘–’, ‘-.’, ‘:’}. Defaults to ‘-’.

  • box_grand_median_width|grand_median_width (float) – Width of the grand median line in pixels. Defaults to 1.

  • box_group_mean (bool) – Toggle visibility of a line showing the mean of each data group on the plot. Defaults to False. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Group-Means

  • box_group_mean_color|group_mean_color (str) – Hex color string for the group mean line. Defaults to #555555.

  • box_group_mean_style|group_mean_style (str) – Line style for the box group mean lines {‘-’, ‘–’, ‘-.’, ‘:’}. Defaults to ‘-’.

  • box_group_mean_width|group_mean_width (float) – Width of the group mean line in pixels. Defaults to 1.

  • box_stat_line (str) – Set the statistic for the connecting line {‘mean’, ‘median’, ‘std’, ‘qXX’ [qunatile where XX is a number between 0-100]}. Defaults to mean. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Stat-line

  • box_stat_line_color (str) – Hex color string for the stat line. Defaults to #666666.

  • box_stat_line_on (bool) – Toggle visibility of the stat line between boxes. Defaults to True.

  • box_stat_line_width (float) – Width of the stat line in pixels. Defaults to 1.

  • DIAMONDS

  • box_mean_diamonds_alpha|mean_diamonds_alpha (float) – Transparency value for the diamonds between 0-1. Defaults to 1.

  • box_mean_diamonds_edge_color|mean_diamonds_edge_color (str) – Hex color string for the edges of the diamond. Defaults to #FF0000.

  • box_mean_diamonds_edge_style|mean_diamonds_edge_style (str) – Line style for the diamonds lines {‘-’, ‘–’, ‘-.’, ‘:’}. Defaults to ‘-’.

  • box_mean_diamonds_edge_width|mean_diamonds_edge_width (float) – Width of the diamond lines in pixels. Defaults to 0.7.

  • box_mean_diamonds_fill_color|mean_diamonds_fill_color (str) – Hex color string for the fill of the diamond. Defaults to None.

  • box_mean_diamonds_width|mean_diamonds_width (float) – Set the fractional width of the diamonds between 0-1. Defaults to 0.8.

  • box_mean_diamonds|mean_diamonds (bool) – Toggle visibility of a diamond overlay on the box showing the group mean and a confidence interval. Defaults to False. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Mean-Diamonds

  • conf_coeff (float) – Confidence interval from 0 to 1. Defaults to 0.95.

  • VIOLINS

  • box_violin|violin (bool) – Toggle visibility of violin plot showing the distribution of box plot data. Defaults to False. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/boxplot.html#Violins

  • violin_box_color (str) – Hex color string for the fill of an optional box overlay on the violin. Defaults to #555555.

  • violin_box_on (bool) – Toggle visibility of a box over the violin plot. Defaults to True.

  • violin_edge_color (str) – Hex color string for the edge of the violins. Defaults to #aaaaaa.

  • violin_fill_alpha (float) – Transparency value for the violin plots between 0-1. Defaults to 0.5.

  • violin_fill_color (str) – Hex color string for the fill of the violins. Defaults to fcp.DEFAULT_COLORS.

  • violin_markers (bool) – Toggle visibility of data point markers on the violin plots. Defaults to False.

  • violin_median_color (str) – Hex color string for the median point in each violin. Defaults to #ffffff.

  • violin_median_marker (str) – Marker type for the median point in each violin. Defaults to ‘o’.

  • violin_median_size (int) – Size of the median point marker in each violin. Defaults to 2.

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_box.csv')
>>> fcp.boxplot(df, y='Value', groups=['Batch', 'Sample'])
../_static/images/example_boxplot.png
fivecentplots.fcp.cbar()

Dummy function to return the colorbar API with help() (not used directly for plotting).

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_contour.csv')
>>> fcp.contour(cc, x='X', y='Y', z='Value', cbar=True, cbar_size=20, xmin=-4, xmax=2, ymin=-4, ymax=2)
../_static/images/example_cbar.png
fivecentplots.fcp.contour(df, **kwargs)

Contour plot module.

Parameters

df (DataFrame) – DataFrame containing data to plot

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_contour.csv')
>>> fcp.contour(cc, x='X', y='Y', z='Value', cbar=True, cbar_size=40, xmin=-4, xmax=2, ymin=-4, ymax=2)
../_static/images/example_contour.png
fivecentplots.fcp.deprecated(kwargs)

Automatically fix deprecated keyword args.

fivecentplots.fcp.figure()

Dummy function to return the figure API with help() (not used directly for plotting).

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             fig_edge_color='#000000', fig_edge_width=3, fig_edge_alpha=0.5,
             fig_fill_color='#96BEAA', fig_fill_alpha=0.8,
             ax_size=[400, 300]
../_static/images/example_figure.png

Figure element is shown in olive green with red border

fivecentplots.fcp.gantt(df, **kwargs)
Gantt chart plotting function. This plot is built off of a horizontal

implementation of fcp.bar.

Parameters

df (DataFrame) – DataFrame containing data to plot

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_gantt.csv')
>>> fcp.gantt(df, x=['Start', 'Stop'], y='Task', ax_size=[600, 400])
../_static/images/example_gantt.png
fivecentplots.fcp.gridlines()

Dummy function to return the gridline API with help() (not used directly for plotting).

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', lines=False, ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             grid_major_x_style='--', grid_major_y_color='#00EE00',
             grid_minor=True, grid_minor_color='#BB0000', grid_minor_y_alpha=0.3, grid_minor_x_width=2
../_static/images/example_gridlines.png
fivecentplots.fcp.grouping()

Dummy function to return the grouping API with help() (not used directly for plotting).

Keyword Arguments
  • col (str) – [1] name of DataFrame column for grouping into columns of subplots based on each unique value; or [2] col=”x” with multiple values defined for “x” creates columns of subplots for each x-value. Defaults to None.

  • groups (str|list) – for xy plot = name of DataFrame column that can be used to separate the data into unique groups so plot lines do not circle back on themselves. Defaults to None. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/grouping.html#xy-plots

  • groups – for boxplot = name or list of names of DataFrame column(s) used to split the data into separate boxes. Defaults to None. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/grouping.html#boxplots

  • row (str) – [1] name of DataFrame column for grouping into rows of subplots based on each unique value; or [2] row=”y” with multiple values defined for “y” creates rows of subplots for each y-value. Defaults to None.

  • wrap (str|list) – [1] name or list of names of DataFrame column(s) for grouping into a grid of subplots; [2] wrap=”x” with multiple values defined for “x” creates a grid of subplots for each x-value; or [3] wrap=”y” with multiple values defined for “y” creates a grid of subplots for each y-value. Defaults to None.

Examples

Row by column style:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', col='Die', row='Substrate',
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost  Level==0.2', ax_size=[300, 250])
../_static/images/example_grouping1.png

Wrap style:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', wrap=['Die', 'Substrate'],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost  Level==0.2', ax_size=[300, 250])
../_static/images/example_grouping2.png

Box plot:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, y='Value', groups=['Batch', 'Sample'])
../_static/images/example_grouping3.png
fivecentplots.fcp.heatmap(df, **kwargs)

Heatmap plot.

Parameters

df (DataFrame) – DataFrame containing data to plot

Keyword Arguments

Examples

Categorical heatmap:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_heatmap.csv')
>>> fcp.heatmap(df, x='Category', y='Player', z='Average')
../_static/images/example_heatmap1.png

Non-uniform numerical data:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_contour.csv')
>>> fcp.heatmap(df, x='X', y='Y', z='Value', row='Batch', col='Experiment',
                cbar=True, share_z=True, ax_size=[400, 400], data_labels=False,
                label_rc_font_size=12, filter='Batch==103', cmap='viridis')
../_static/images/example_heatmap2.png
fivecentplots.fcp.hist(df, **kwargs)

Histogram plot.

Parameters

df (DataFrame | numpy array) – DataFrame or numpy array containing data to plot [when passing a numpy array it is automatically converted to a DataFrame]

Keyword Arguments

Examples

Simple histogram:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_box.csv')
>>> fcp.hist(df, x='Value')
../_static/images/example_hist1.png

Bayer-image histogram:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> import numpy as np
>>> # Make a dummy blue patch through an RGB filter
>>> img_rgb = np.zeros([300, 300]).astype(np.uint16)
>>> img_rgb[::2, ::2] = 180  # green_red
>>> img_rgb[1::2, 1::2] = 180  # green_blue
>>> img_rgb[::2, 1::2] = 10
>>> img_rgb[1::2, ::2] = 255
>>> # Add gaussian shading
>>> x, y = np.meshgrid(np.linspace(-1,1,300), np.linspace(-1,1,300))
>>> dst = np.sqrt(x*x+y*y)
>>> sigma = 1
>>> muu = 0.001
>>> gauss = np.exp(-( (dst-muu)**2 / ( 2.0 * sigma**2 ) ) )
>>> img_rgb = (gauss * img_rgb).astype(float)
>>> # Add random noise
>>> img_rgb[::2, ::2] += np.random.normal(-0.1*img_rgb[::2, ::2].mean(), 0.1*img_rgb[::2, ::2].mean(),
>>>                                       img_rgb[::2, ::2].shape)
>>> img_rgb[1::2, ::2] += np.random.normal(-0.1*img_rgb[1::2, ::2].mean(), 0.1*img_rgb[1::2, ::2].mean(),
>>>                                        img_rgb[1::2, ::2].shape)
>>> img_rgb[1::2, 1::2] += np.random.normal(-0.1*img_rgb[1::2, 1::2].mean(), 0.1*img_rgb[1::2, 1::2].mean(),
>>>                                         img_rgb[1::2, 1::2].shape)
>>> img_rgb[::2, 1::2] += np.random.normal(-0.1*img_rgb[::2, 1::2].mean(), 0.1*img_rgb[::2, 1::2].mean(),
>>>                                        img_rgb[::2, 1::2].shape)
>>> img_rgb = img_rgb.astype(np.uint16)
>>> fcp.hist(img_rgb, ax_size=[600, 400], legend='Plane', cfa='grbg', colors=fcp.BAYER, **fcp.HIST)
../_static/images/example_hist2.png
fivecentplots.fcp.imshow(df, **kwargs)

Image show plotting function.

Parameters

df (DataFrame | numpy array) – DataFrame or numpy array containing 2D row/column image data to plot [when passing a numpy array it is automatically converted to a DataFrame]

Keyword Arguments

Examples

Basic:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> import imageio
>>> # Read an image from the world-wide web
>>> url = 'https://imagesvc.meredithcorp.io/v3/mm/image?q=85&c=sc&rect=0%2C214%2C2000%2C1214&'         >>>       + 'poi=%5B920%2C546%5D&w=2000&h=1000&url=https%3A%2F%2Fstatic.onecms.io%2Fwp-content%2Fuploads'         >>>       + '%2Fsites%2F47%2F2020%2F10%2F07%2Fcat-in-pirate-costume-380541532-2000.jpg'
>>> imgr = imageio.imread(url)
>>> # Convert to grayscale
>>> img = fcp.utilities.img_grayscale(imgr)
>>> fcp.imshow(img, ax_size=[600, 600])
../_static/images/example_imshow1.png

With +/- 3 sigma contrast stretching:

>>> uu = img.stack().mean()
>>> ss = img.stack().std()
>>> fcp.imshow(img, cmap='inferno', cbar=True, ax_size=[600, 600], zmin=uu-3*ss, zmax=uu+3*ss)
../_static/images/example_imshow2.png
fivecentplots.fcp.labels()

Dummy function to return the labels API with help() (not used directly for plotting).

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', col='Die', row='Substrate',
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2', ax_size=[300, 250],
             label_rc_edge_color='#000000', label_rc_edge_width=2,
             label_row_font_color='#AA0000', label_row_fill_alpha=0.5, label_row_fill_color='#00AA00',
             label_col_fill_color='#0000AA',
             label_x_font_style='normal', label_y_font_color='#AABBCC', label_x_fill_color='#DDDDDD')
../_static/images/example_labels.png
fivecentplots.fcp.legend()

Dummy function to return the legend API with help() (not used directly for plotting).

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2', ax_size=[400, 300],
             legend_edge_color='#555555', legend_edge_width=2, legend_font_size=10,
             legend_marker_size=10, legend_marker_alpha=0.5, legend_title='DS9')
../_static/images/example_legend.png
fivecentplots.fcp.lines()

Dummy function to return the lines API with help() (not used directly for plotting).

Keyword Arguments

Examples

All lines the same color:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             line_color='#000000', line_width=2)
../_static/images/example_lines1.png

Patterns of alternating custom color and style:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             line_color=['#AA00AA', '#00AA00', '#0000AA'],  line_width=2, line_style=['-', '--'])
../_static/images/example_lines2.png

Use a colormap with alpha:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             cmap='viridis', lines_alpha=0.7)
../_static/images/example_lines3.png

No lines:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             lines=False)
../_static/images/example_lines4.png
fivecentplots.fcp.markers()

Dummy function to return the markers API with help() (not used directly for plotting).

Keyword Arguments

Examples

No markers:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             markers=False)
../_static/images/example_markers1.png

Styled markers:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             marker_size=10, marker_edge_width=2, marker_fill=True)
../_static/images/example_markers2.png

Custom markers types and color (a mix of indices from the fcp.DEFAULT_COLORS list and a custom hex color):

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             markers=['o', None, '+', '*', 'B', None], marker_edge_color=[3, 0, 6, 1, '#FF0000'])
../_static/images/example_markers3.png
fivecentplots.fcp.nq(df, **kwargs)

Plot the normal quantiles of a data set.

Parameters

df (DataFrame | numpy array) – DataFrame containing a column of values data or a DataFrame or numpy array containing a set of 2D values that can be used to calculate quantiles at various “sigma” intervals

Keyword Arguments

Examples

“Normal” distribution:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> import numpy as np
>>> # Make a normal distribution from noise
>>> img = np.ones([1000, 1000]) * 2**12 / 2
>>> img += np.random.normal(-0.025*img.mean(), 0.025*img.mean(), img.shape)
>>> fcp.nq(img, marker_size=4, line_width=2)
../_static/images/example_nq.png
fivecentplots.fcp.options()

Dummy function to return the API for other control options with help() (not used directly for plotting).

Keyword Arguments
  • BAYER (list) – Color scheme for RGGB channel data so lines and markers match CFA type. Defaults to None. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/hist.html#RGB

  • DEFAULT_COLORS (list) – Default color scheme used for lines and markers (from colors.py). Defaults to None.

  • HIST (dict) – Shortcut of useful kwargs to format hist plots {‘ax_scale’: ‘logy’, ‘markers’: False, ‘line_width’: 2, ‘preset’: ‘HIST’}. Defaults to None. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/hist.html#fcp.HIST

  • engine (str) – Specify the plotting engine {‘mpl’, ‘bokeh’}. Defaults to ‘mpl’. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/layout.html#engine

  • filename (str) – Name of the saved image (with or without path and/or extension). Defaults to Automatic name based on conditions with extention ‘.png’. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/grouping.html#figure-plots

  • filepath (str) – Name of the directory to save images (convenient if you want to use the default naming but save in a different directory. Defaults to current directory.

  • inline (boolean) – Flag to display the rendered plot in the native plotting viewer or jupyter notebook (convenient to disable if doing automated batch plotting). Defaults to True.

  • print_filename (boolean) – Print the output filename. Defaults to False. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/grouping.html#figure-plots

  • return_filename (boolean) – Return the output filename. Defaults to False.

  • save (boolean) – Save the plot to disc. Defaults to False.

  • save_data (boolean) – Save the DataFrame subset that is created and used by a given plot. Defaults to False.

  • save_ext (str) – Set the file extension of saved plots to determine the format. Defaults to depends on plotting engine {‘mpl’: ‘.png’, ‘bokeh’: ‘.html’}.

  • show (str) – Show the saved plot image using the default image viewer of the host PC. Defaults to False.

  • theme (str) – Select a theme file for the current plot only. Defaults to None. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/styles.html#On-the-fly

  • timer (boolean) – Debug feature to get a time log for each step in the plotting process. Defaults to False.

fivecentplots.fcp.paste_kwargs(kwargs: dict) dict

Get the kwargs from contents of the clipboard in ini file format.

Parameters

kwargs – originally inputted kwargs

Returns

copied kwargs

fivecentplots.fcp.pie(df, **kwargs)

Pie chart

Parameters

df (DataFrame) – DataFrame containing data to plot

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data/fake_data_bar.csv')
>>> df.loc[df.pH < 0, 'pH'] = -df.pH
>>> fcp.pie(df, x='Liquid', y='pH', filter='Measurement=="A" & T [C]==25')
../_static/images/example_pie.png
fivecentplots.fcp.plot(df, **kwargs)

XY plot.

Parameters

df (DataFrame) – DataFrame containing data to plot

Keyword Arguments

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2')
../_static/images/example_plot.png
fivecentplots.fcp.plot_bar(data, layout, ir, ic, df_rc, kwargs)

Plot data as boxplot

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_box(dd, layout, ir, ic, df_rc, kwargs)

Plot data as boxplot

Parameters
  • dd (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

Keywords:

fivecentplots.fcp.plot_contour(data, layout, ir, ic, df_rc, kwargs)

Plot contour data

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_control_limit(ir: int, ic: int, iline: int, layout: engines.Layout, data: data.Data)

Add control limit shading to a plot.

Args:

fivecentplots.fcp.plot_fit(data, layout, ir, ic, iline, df, x, y, twin, leg_name, ngroups)

Plot a fit line

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • iline (int) – iterator

  • df (pd.DataFrame) – input data

  • x (str) – x-axis column name

  • y (str) – y-axis column name

  • twin (bool) – denote twin axis

  • leg_name (str) – legend value

  • ngroups (int) – number of groups in this data set

fivecentplots.fcp.plot_gantt(data, layout, ir, ic, df_rc, kwargs)

Plot data as gantt chart

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_heatmap(data, layout, ir, ic, df_rc, kwargs)

Plot heatmap data data

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_hist(data, layout, ir, ic, df_rc, kwargs)

Plot data as histogram

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_imshow(data, layout, ir, ic, df_rc, kwargs)

Show an image

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_interval(ir, ic, iline, data, layout, df, x, y, twin)

Add a point-by-point interval based color band around a line plot

fivecentplots.fcp.plot_nq(data, layout, ir, ic, df_rc, kwargs)

Plot data as normal quantiles by sigma

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_pie(data, layout, ir, ic, df, kwargs)

Plot a pie chart

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plot_ref(ir, ic, iline, data, layout, df, x, y)

Plot a reference line

fivecentplots.fcp.plot_stat(ir, ic, iline, data, layout, df, x, y, leg_name=None, twin=False)

Plot a line calculated by stats

fivecentplots.fcp.plot_xy(data, layout, ir, ic, df_rc, kwargs)

Plot xy data

Parameters
  • data (obj) – Data object

  • layout (obj) – layout object

  • ir (int) – current subplot row number

  • ic (int) – current subplot column number

  • df_rc (pd.DataFrame) – data subset

  • kwargs (dict) – keyword args

fivecentplots.fcp.plotter(dobj, **kwargs)

Main plotting function

UPDATE At minimum, it requires a pandas DataFrame with at least two columns and two column names for the x and y axis. Plots can be customized and enhanced by passing keyword arguments as defined below. Default values that must be defined in order to generate the plot are pulled from the fcp_params default dictionary

Parameters

dobj (Data object) – data class for the specific plot type

Keyword Arguments

type (Defined by the specific plot) –

Returns

plots

fivecentplots.fcp.set_theme(theme=None, verbose=False)

Select a “defaults” file and copy to the user directory

fivecentplots.fcp.tick_labels()

Dummy function to return the tick labels API with help() (not used directly for plotting).

Keyword Arguments
  • tick_labels (boolean) – Enable/disable all tick labels. Defaults to True.

  • tick_labels_edge_alpha (float) – Transparency value for all tick labels background edges between 0-1. Defaults to 0.

  • tick_labels_edge_color (str) – Hex color string for all tick label background edges. Defaults to #ffffff.

  • tick_labels_edge_width (float) – Width of the border edge of all tick labels in pixels. Defaults to 0.

  • tick_labels_fill_alpha (float) – Transparency value for the background fill of all tick labels between 0-1. Defaults to 1.

  • tick_labels_fill_color (str) – Hex color string for all tick label background edges. Defaults to #ffffff.

  • tick_labels_font (str) – Font for all tick labels. Defaults to sans-serif.

  • tick_labels_font_color (str) – Hex color string for font color of all tick labels. Defaults to #000000.

  • tick_labels_font_size (str) – Font size for all tick labels. Defaults to 13.

  • tick_labels_font_style (str) – Font style {‘normal’|’italic’|’oblique’} for all tick labels. Defaults to normal.

  • tick_labels_font_weight (str) – Font weight {‘normal’|’bold’|’heavy’|’light’|’ultrabold’|’ultralight’} of all tick labels. Defaults to normal.

  • tick_labels_major (boolean) – Enable/disable all major tick labels. Defaults to True.

  • tick_labels_major_edge_alpha (float) – Transparency value for all major tick labels background edges between 0-1. Defaults to 0.

  • tick_labels_major_edge_color (str) – Hex color string for all major tick label background edges. Defaults to #ffffff.

  • tick_labels_major_edge_width (float) – Width of the border edge of all major tick labels in pixels. Defaults to 0.

  • tick_labels_major_fill_alpha (float) – Transparency value for the background fill of all major tick labels between 0-1. Defaults to 1.

  • tick_labels_major_fill_color (str) – Hex color string for all major tick label background edges. Defaults to #ffffff.

  • tick_labels_major_font (str) – Font for all major tick labels. Defaults to sans-serif.

  • tick_labels_major_font_color (str) – Hex color string for font color of all major tick labels. Defaults to #000000.

  • tick_labels_major_font_size (str) – Font size for all major tick labels. Defaults to 13.

  • tick_labels_major_font_style (str) – Font style {‘normal’|’italic’|’oblique’} for all major tick labels. Defaults to normal.

  • tick_labels_major_font_weight (str) – Font weight {‘normal’|’bold’|’heavy’|’light’|’ultrabold’|’ultralight’} of all major tick labels. Defaults to normal.

  • tick_labels_major_q (boolean) – Enable/disable major tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to True.

  • tick_labels_major_q_edge_alpha (float) – Transparency value for major tick labels background edges of a specific axes between 0-1 [where q = x, y, x2, y2]. Defaults to 0.

  • tick_labels_major_q_edge_color (str) – Hex color string for major tick label background edges of a specific axis [where q = x, y, x2, y2]. Defaults to #ffffff.

  • tick_labels_major_q_edge_width (float) – Width of the border edge of all major tick labels of a specific axis in pixels [where q = x, y, x2, y2]. Defaults to 0.

  • tick_labels_major_q_fill_alpha (float) – Transparency value for the background fill of all major tick labels of a specific axis between 0-1 [where q = x, y, x2, y2]. Defaults to 1.

  • tick_labels_major_q_fill_color (str) – Hex color string for major tick label background edges of a specific axis [where q = x, y, x2, y2]. Defaults to #ffffff.

  • tick_labels_major_q_font (str) – Font for major tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to sans-serif.

  • tick_labels_major_q_font_color (str) – Hex color string for font color of major tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to #000000.

  • tick_labels_major_q_font_size (str) – Font size for major tick labels of a specific axes label [where q = x, y, x2, y2]. Defaults to 13.

  • tick_labels_major_q_font_style (str) – Font style {‘normal’|’italic’|’oblique’} for major tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to normal.

  • tick_labels_major_q_font_weight (str) – Font weight {‘normal’|’bold’|’heavy’|’light’|’ultrabold’|’ultralight’} of major tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to normal.

  • tick_labels_minor (boolean) – Enable/disable all minor tick labels. Defaults to False.

  • tick_labels_minor_edge_alpha (float) – Transparency value for all minor tick labels background edges between 0-1. Defaults to 0.

  • tick_labels_minor_edge_color (str) – Hex color string for all minor tick label background edges. Defaults to #ffffff.

  • tick_labels_minor_edge_width (float) – Width of the border edge of all minor tick labels in pixels. Defaults to 0.

  • tick_labels_minor_fill_alpha (float) – Transparency value for the background fill of all minor tick labels between 0-1. Defaults to 1.

  • tick_labels_minor_fill_color (str) – Hex color string for all minor tick label background edges. Defaults to #ffffff.

  • tick_labels_minor_font (str) – Font for all minor tick labels. Defaults to sans-serif.

  • tick_labels_minor_font_color (str) – Hex color string for font color of all minor tick labels. Defaults to #000000.

  • tick_labels_minor_font_size (str) – Font size of a specific axes label [where q = x, y, x2, y2]. Defaults to 10.

  • tick_labels_minor_font_style (str) – Font style {‘normal’|’italic’|’oblique’} for all minor tick labels. Defaults to normal.

  • tick_labels_minor_font_weight (str) – Font weight {‘normal’|’bold’|’heavy’|’light’|’ultrabold’|’ultralight’} of all minor tick labels. Defaults to normal.

  • tick_labels_minor_q (boolean) – Enable/disable minor tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to False.

  • tick_labels_minor_q_edge_alpha (float) – Transparency value for the label edge of a specific axes between 0-1 [where q = x, y, x2, y2]. Defaults to 0.

  • tick_labels_minor_q_edge_color (str) – Hex color string for minor tick label background edges of a specific axis [where q = x, y, x2, y2]. Defaults to #ffffff.

  • tick_labels_minor_q_edge_width (float) – Width of the border edge of all minor tick labels of a specific axis in pixels [where q = x, y, x2, y2]. Defaults to 0.

  • tick_labels_minor_q_fill_alpha (float) – Transparency value for the background fill of all minor tick labels of a specific axis between 0-1 [where q = x, y, x2, y2]. Defaults to 1.

  • tick_labels_minor_q_fill_color (str) – Hex color string for minor tick label background edges of a specific axes [where q = x, y, x2, y2]. Defaults to #ffffff.

  • tick_labels_minor_q_font (str) – Font for minor tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to sans-serif.

  • tick_labels_minor_q_font_color (str) – Hex color string for font color of minor tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to #000000.

  • tick_labels_minor_q_font_size (str) – Font size for all minor tick labels. Defaults to 10.

  • tick_labels_minor_q_font_style (str) – Font style {‘normal’|’italic’|’oblique’} for minor tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to normal.

  • tick_labels_minor_q_font_weight (str) – Font weight {‘normal’|’bold’|’heavy’|’light’|’ultrabold’|’ultralight’} of minor tick labels of a specific axes [where q = x, y, x2, y2]. Defaults to normal.

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             tick_labels_major_x_font_color='#FF0000', tick_labels_major_x_font_style='italic',
             tick_labels_major_x_fill_color='#EEEEEE', tick_labels_major_x_edge_color='#0000FF',
             tick_labels_minor=True, tick_labels_minor_y_font_weight='bold', tick_labels_minor_x_edge_width=1,
             tick_labels_minor_y_edge_color='#00FF00', tick_labels_minor_y_edge_width=1,
             tick_labels_minor_y_font_color='#FF00FF', tick_labels_minor_x_rotation=45,
             tick_labels_minor_y_fill_color='#000000', tick_labels_minor_font_size=6)
../_static/images/example_tick_labels.png
fivecentplots.fcp.ticks()

Dummy function to return the ticks API with help() (not used directly for plotting).

Keyword Arguments

Examples

Default styling:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y=['Voltage', 'I [A]'], legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2')
../_static/images/example_ticks1.png

Ugly styling:

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y=['Voltage', 'I [A]'], legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             ticks_major_increment=0.1,
             ticks_major_x_color='#000000', ticks_major_x_length=15, ticks_major_x_width=4,
             ticks_major_y_color='#0000FF', ticks_major_y_direction='out',
             ticks_minor=True, ticks_minor_number=3, ticks_minor_color='#00FF00')
../_static/images/example_ticks2.png
fivecentplots.fcp.titles()

Dummy function to return the figure title API with help() (not used directly for plotting).

Keyword Arguments
  • title (str) – Figure title text. Defaults to None. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/styles.html#Fonts

  • title_edge_alpha (float) – Transparency value for the title area edge between 0-1. Defaults to 1.

  • title_edge_color (str) – Hex color string for the title area edge. Defaults to #ffffff.

  • title_edge_width (float) – Width of the border edge of a title area in pixels. Defaults to 1.

  • title_fill_alpha (float) – Transparency value for the title area background fill between 0-1. Defaults to 1.

  • title_fill_color (str) – Hex color string for the title area edge. Defaults to #ffffff.

  • title_font (str) – Font for the figure title. Defaults to sans-serif. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/styles.html#Fonts

  • title_font_color (str) – Hex color string for font color of the figure title. Defaults to #000000.

  • title_font_size (str) – Font size for the figure title. Defaults to 18.

  • title_font_style (str) – Font style {‘normal’|’italic’|’oblique’} for the figure title. Defaults to italic. Example: https://endangeredoxen.github.io/fivecentplots/0.5.0/styles.html#Fonts

  • title_font_weight (str) – Font weight {a numeric value in range 0-1000|’ultralight’|’light’|’normal’|’regular’|’b ook’|’medium’|’roman’|’semibold’|’demibold’|’demi’|’bold’|’heavy’|’extra bold’|’black’} for the figure title. Defaults to bold.

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', legend=['Die', 'Substrate'], ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2',
             title='Vaxis III', title_edge_alpha=0.5, title_edge_color='#333333',
             title_edge_width=2, title_fill_alpha=0.2, title_fill_color='#00AA88',
             title_font='monospace', title_font_size=24, title_font_style='oblique',
             title_font_weight=700)
../_static/images/example_title.png
fivecentplots.fcp.ws()

Dummy function to return the white space API with help() (not used directly for plotting).

Keyword Arguments
  • ws_ax_box_title (int) – White space between axes edge and box plot titles. Defaults to 10.

  • ws_ax_cbar (int) – White space from right axes edge to left side of cbar. Defaults to 10.

  • ws_ax_fig (int) – White space right edge of axes to right edge of figure [if no legend present]. Defaults to 10.

  • ws_ax_label_xs (int) – Extra white space between axes and label when using separate labels. Defaults to 5.

  • ws_ax_leg (int) – White space from right edge of axes to left edge of legend [if present]. Defaults to 5.

  • ws_col (int) – White space between column subplots [ignored if tick labels or axes labels are present and wider than this]. Defaults to 30.

  • ws_fig_ax (int) – White space from left figure edge to axes left edge. Defaults to 10.

  • ws_fig_label (int) – White space between top of figure and x2 label [if present]. Defaults to 10.

  • ws_fig_title (int) – White space from top of figure to top of title [if present]. Defaults to 10.

  • ws_label_col (int) – White space from axes and col labels. Defaults to ws_label_rc.

  • ws_label_fig (int) – White space from bottom of x label to bottom of figure. Defaults to ws_fig_label.

  • ws_label_rc (int) – White space between axes and row & col labels. Defaults to 10.

  • ws_label_row (int) – White space from axes to row labels. Defaults to ws_label_rc.

  • ws_label_tick (int) – White space from edge of axes label to edge of tick labels. Defaults to 10.

  • ws_leg_fig (int) – White space from right of legend in position 0 and figure right edge. Defaults to 10.

  • ws_row (int) – White space between row subplots [ignored if tick labels or axes labels are present and wider than this]. Defaults to 30.

  • ws_tick_minimum (int) – Minimum width for tick labels. Defaults to 10.

  • ws_ticks_ax (int) – White space from tick labels to edge of axes. Defaults to 5.

  • ws_title_ax (int) – White space bottom of title to top of axes. Defaults to 10.

Examples

>>> import fivecentplots as fcp
>>> from pathlib import Path
>>> import pandas as pd
>>> df = pd.read_csv(Path(fcp.__file__).parent / 'test_data' / 'fake_data.csv')
>>> fcp.plot(df, x='Voltage', y='I [A]', row='Die', col='Substrate', ax_size=[400, 300],
             filter='Target Wavelength==450 & Temperature [C]==25 & Boost Level==0.2', save=True,
             fig_edge_color='#000000',
             ws_col=100, ws_row=0, ws_ax_fig=250, ws_label_rc=30, ws_ticks_ax=25, ws_label_tick=25)
../_static/images/example_ws.png