API Reference

For figure layout, the most useful functions will be updater to construct a common object, plot_figures to place figures in the document, relative_dimensions for sizing plots correctly.

The ids function can sometimes be useful for debugging purposes.

figure_second.plot_figuresMethod
plot_figures(updater::Updater, figure_map::Dict{String, Makie.Figure})

updater is a wrapper around the python class. It represents the inkscape svg document we are plotting on.

figure_map is a dictionary with keys containing ids of inkscape objects (rectangles or images) to plot on top of. The values of figure_map are figures to render.

The user is responsible for filling each figure with content, and sizing it appropriately to the dimensions of the inkscape object. See relative_dimensions for sizing considerations.

source
figure_second.plot_figuresMethod
plot_figures(updater::Updater, figure_map::Dict{String, Plots.Plot})

updater is a wrapper around the python class. It represents the inkscape svg document we are plotting on.

figure_map is a dictionary with keys containing ids of inkscape objects (rectangles or images) to plot on top of. The values of figure_map are figures to render (outputs of Plots.jl plot() functions.

The user is responsible for filling each figure with content, and sizing it appropriately to the dimensions of the inkscape object. See relative_dimensions for sizing considerations.

source
figure_second.python_bindings.relative_dimensionsMethod
relative_dimensions(updater::Updater, id::String, height::Float64)::Tuple{Float64, Float64}

Calculate the required dimension pair (width, height) to maintain the aspect ratio of the inkscape object. Returns result in fractional units.

source
figure_second.python_bindings.relative_dimensionsMethod
relative_dimensions(updater::Updater, id::String, height::Int)::Tuple{Int, Int}

Calculate the required dimension pair (width, height) to maintain the aspect ratio of the inkscape object. Rounds the otherwise float point value and converts to Int.

This is useful for plotting functions that expect an interger number for pixel dimensions

source
figure_second.python_bindings.updateMethod
update(updater::Updater, map::Dict{String, String})

low level function to update the contents of an inkscape file. The map argument maps an inkscape object's id to a file path containing a .png encoded image. The .png encoded image (dictionary value) will be placed in the inkscape object with the id of the key.

source
figure_second.python_bindings.updaterMethod
updater(base_path::String, output_file::String)::Updater

Updater constructor for a workflow that reads in a file base_path and exports all changes under a new file output_file.

This Updater instance will not mutate the underlying base_path inkscape file

source