releases 2026-11-06

This release breaks with 0.16.1 on where a layer is drawn when it names columns other than its pose’s. In 0.17.0, a layer added to a pose that draws one panel is drawn on that panel, whatever columns the layer names. In 0.16.1, a layer naming other columns was given a panel of its own, unless the pose was given to pj/overlay. Separate panels are made with pj/facet or pj/arrange. Three other ways of writing a plot that drew several panels in 0.16.1 also change: • pj/pose given other columns on an existing pose replaces the pose’s columns; • a vector of columns draws all the columns together on a single panel; • a vector of column pairs reports an error that shows how to write the panels. For this release, a layer naming other columns, pj/pose replacing a column, and a vector of columns each print a Note that names the 0.16.1 behaviour. The main changes: • A layer added to a pose that draws one panel is drawn on that panel, whatever columns the layer names. Each axis is titled by every column drawn on it, and a layer with no colour of its own takes a colour and a legend entry. pj/overlay is retired. • More ways to create panels with pj/facet and pj/arrange. pj/facet takes a map, and draws a panel for each category of a column, a panel for each of several columns, or a grid that crosses the two. pj/matrix draws a scatter plot matrix. A cell of pj/arrange can be anything pj/pose accepts after the data -- a column, a mapping or a pose -- and a vector in the list of cells is a list of cells. • A vector of columns, written where one column goes, draws all those columns together on a single panel, as a series with a colour and a legend entry for each column. • pj/pose given an existing pose updates that pose instead of adding a panel. Its mapping is merged into the pose’s mapping, and a column given again replaces the old one. A scale, :where or :theme given twice is combined key by key. • One option, :share-scales, says which axes panels share, on a facet and on an arrangement alike. A shared axis spans the values drawn in all the panels that share it. Also new: :where filters the rows a pose draws, panels can be given unequal sizes, and an axis that shows a computed count or density is titled count or density. The updated signature of pj/pose -- data or a pose, then columns, then a mapping -- began in https://github.com/scicloj/plotje/pull/61, which also gave the scatter plot matrix a function of its own, the idea behind pj/matrix, so that pj/pose no longer needs to take a list of pairs of columns, and let pj/arrange take columns and poses as cells. Thanks to @timothypratley for that pull request, and for the questions, discussions and reports on Zulip that shaped this release.

Plots that look different after upgrading • A layer naming columns other than its pose’s, added to a pose that draws one panel, is drawn on that panel, and each axis is titled by every column drawn on it. A layer with no colour of its own takes a colour and a legend entry naming its columns, and a layer that specifies a colour, such as a black trend line, keeps it. A layer beside a series is drawn on the series’ panel in the same way. For this release a Note says so; for a panel per column, write (pj/facet pose {:y [:hwy :cty]}) or use pj/arrange. • A vector of columns given where one column goes, as in (pj/lay-density data [:a :b :c]), draws all the columns together on a single panel, as a series with a colour and a legend entry for each column. For this release a Note says so; for a panel per column, write (-> data (pj/arrange [:a :b :c]) pj/lay-density). • pj/pose given a mapping on an existing pose merges the mapping into the pose’s mapping and adds no panel. A new :x or :y replaces the old one, so (-> data (pj/pose :a :b) (pj/pose :c :d)) draws one plot of :c and :d. On a composite the mapping goes to the root. For this release a Note says when pj/pose replaces a column; for panels side by side, write (pj/arrange data [{:x :a :y :b} {:x :c :y :d}]). • A scale or a :theme given twice is combined key by key. After (pj/scale pose :x :log), (pj/pose pose :a :b {:color :c}) keeps the log scale, and pj/options given a :theme twice keeps the keys of both. A warning names a :domain or another column-specific scale setting kept when the aesthetic is given another column, and (pj/pose pose {:x nil}) starts the aesthetic afresh. Every other option is replaced whole. • A series titles its axis by its columns, revenue, cost, and lists its legend entries in the order the columns are written. The legend has no title unless :as names the key column or a title is specified. A counting layer beside a series, such as a bar, counts each row of the data once. • A series faceted by its key column, (pj/facet pose :series), draws a panel per column, each titled by its column, with a value axis of its own and no legend. • A written colour on a layer, such as (pj/lay-smooth pose {:color "black"}), is drawn as written and has no legend entry, also where the pose sets a colour scale. {:color {:value "trend" :scale true}} reads a value through the scale. • An axis title too long for the plot is broken into lines after the commas between the columns it names. At most four lines are drawn. • A shared axis spans the values drawn in all the panels that share it, padded once, in a facet and in an arrangement alike. So each panel has the axis the plot would have without the facet. The values are measured after the statistics, so a shared axis reaches the top of a stack and the ends of an error bar. • Cells drawn from the data of the pose they are arranged into, as in (-> data (pj/arrange [{:x :a :y :b} {:x :a :y :c}]) pj/lay-point), share each axis on which they draw one column. The column is titled, and its ticks labelled, on the outer cells only. :share-scales sets the sharing, and #{} labels the ticks of every cell. • A :domain on one cell of a shared axis is the domain of every cell sharing that axis. Cells specifying different domains for one shared axis report an error naming both. • A count or density axis is shared among panels that compute the same thing from the same column, in a facet and in an arrangement. A count is not shared with a density or with a column’s values, and {:share-scales {:y :all}} shares the counts of different columns. • A colour or shape legend under a facet lists its categories in the order of the rows of the whole data, as the same plot without the facet does. So a category keeps its colour when a facet is added. A :domain on the scale sets the order. • Strips of a grid of cells, as in a scatter plot matrix, stand where a facet’s do: column strips above the panels, and row strips at the right. They name the columns as the axis titles do, sepal length. • The diagonal of a scatter plot matrix draws a numerical column’s histogram or density within that column’s range, on its row’s :y axis, so each row’s tick labels stand at the left edge. • Panels arranged side by side or stacked come out the same size where some cells draw no tick labels on an axis they share. The rows of a scatter plot matrix stand as close together as its columns. • Titles in an arrangement. Under an arrangement with a :title, cells with titles of their own keep them, each above its cell. An arrangement or a facet over columns placed as a cell draws its :title and :subtitle once above its cells, and its :caption once below them. • pj/arrange with :cols whose last row is short draws the cells of that row at the size of the cells above. • A lay-* call naming columns no cell of an arrangement draws adds a cell to the arrangement’s list of cells: added to a row of two cells, the new cell is the third in that row. • A plot option given to pj/arrange, such as {:x-label "X"}, is written on the arrangement as pj/options writes it. A key pj/arrange does not read warns. • :panel-width or :panel-height written on an arrangement sets the size of the panels of its cells, and the arrangement’s size is worked out from them, as a single plot’s is. {:panel-width 150} on a row of two cells draws each panel 150 wide. • Bars drawn across, with the value on :x, start at the panel’s edge: the :x axis begins at zero and is padded only past the longest bar, as the :y axis is under upright bars. • A histogram, a density or a count bar titles the axis it computes count or density, also on a pose that names a :y column the layer does not read. {:y-label ""} removes an axis title and the room it takes. Reported on Zulip - thanks, @timothypratley • A histogram, a density, a summary or a smooth grouped or coloured by a column with missing values removes the rows with no value in that column and prints how many, as the other layer types do. • Plots under (pj/coord :polar) draw axis titles and tick labels: the angle’s labels around the circle, and the radius’s at the left edge. • Plots under (pj/coord :fixed) draw one data unit at the same length on both axes, measured inside the panel’s padding. • A short numeric axis, as on a small panel, carries at least two tick labels where they fit.

Added • pj/facet takes a map. {:y [:hwy :cty]} draws a panel per column, and {:x [..] :y [..]} a panel per pair of columns. Under :col and :row the map draws a grid, a panel for each value across with each value down, and each entry is a column of categories or a map of columns: {:col :year :row :drv}, or {:col :drv :row {:y [:hwy :cty]}}. nil in a list of columns leaves a place for a marginal distribution. • Two pj/facet calls, one over categories and one over columns, in either order, write the pose that one call with :col and :row writes. • pj/facet takes a map of plot options last, the map pj/options takes: (pj/facet pose :drv {:share-scales #{:x}}). • A :domain on :col or :row, as in (pj/scale pose :col {:domain ["r" "f" "4"]}), orders the panels of a facet. • pj/matrix draws a scatter plot matrix: (pj/matrix data cols) crosses a list of columns with itself, and (pj/matrix data xs ys) crosses two lists. It returns the pose (pj/facet data {:col {:x xs} :row {:y ys}}) returns, and a map of plot options may come last. (pj/matrix data [:a nil] [nil :b]) draws a scatter plot of :a and :b with a marginal distribution of each. • Under a facet over columns, a layer naming no column is drawn in every panel, on that panel’s columns, and a layer naming one of the facet’s columns is drawn only in that column’s panels. A panel no layer draws takes the layer type inferred from its columns, so a scatter plot matrix draws histograms on its diagonal. • pj/arrange takes columns, mappings and poses as cells: a column is a panel of that column, and a mapping such as {:x :a :y :b} a panel of the columns it names. A vector in the list of cells is a list of cells, so (pj/arrange data [[:a :b] [:c :d]]) is a 2x2 grid. The first argument may be a pose, whose data, mapping, layers, row filter and options reach every cell. • pj/arrange given an arrangement appends the new cells to its list of cells: (-> (pj/arrange data [:a :b]) (pj/arrange [:c])) draws one row of three panels. • (pj/pose data p) draws the pose p from that data, as a cell of pj/arrange does. A pose carrying data of its own keeps it. • pj/lay-* given nil, as in (pj/lay-point nil :a :b), builds a pose with that layer and no data. pj/with-data, or an arrangement given data, gives it the data. • :share-scales says which axes panels share, on a facet and on an arrangement alike. A set names the axes: #{:x} shares :x and fits :y to each panel, and #{} shares neither. A map groups the columns that share an axis: {:y [[:hwy :cty]]} shares :y between the panels drawing :hwy and :cty, and {:y :all} between every panel. A categorical axis is shared as a numerical one is, listing the categories of every sharing cell. • :col-weights and :row-weights, plot options, share out the columns and rows of panels of an arrangement or of a facet over columns: {:col-weights [3 1]} draws the first column’s panels three times as wide as the second’s, and the plot keeps its :width. On the same plots :panel-width and :panel-height take a vector, one size per column or row in drawing units. A vector of the wrong length reports an error. • :where, a map from column to value or set of values, draws only the rows that match. It is written in pj/pose beside a mapping, as in (pj/pose data :displ :hwy {:where {:drv "f"}}), or as a cell of pj/arrange, {:where {:drv "f"}}. Cells filtered this way are labelled by strips naming their values, as the panels of a facet are. Two filters that meet, such as a cell’s under its pose’s, combine column by column, and a column named in both takes the later or inner value. • A layer that names one column reads the panel’s column on the other axis, where its layer type draws from two columns: (-> data (pj/lay-point :week :adults) (pj/lay-line {:y :children})) draws the line of :children against :week. • A column named on :y alone is drawn on its side by a layer type that draws from one column: (pj/pose data {:y :hwy}) draws a histogram on its side, and pj/lay-bar draws a bar chart of counts across. • layer-type/register! takes :column-counts, the set of numbers of columns a layer type draws from: #{1} for an x column alone, #{2} for x and y, #{1 2} for either. It decides which panels of a facet a layer is drawn in, and whether a pose naming only :y draws the layer on its side. layer-type/column-counts reads it back. • A stat declares what it computes for an axis with a method on [stat :computes]: :bin declares {:y :count}, or {:y :density} under :normalize :density. Sharing an axis, the Note for layers sharing a panel, and the check for a missing :y column read the declaration, so an extension’s stat takes part in all three. See “What a stat computes” in the Extensibility chapter. • :legend-font-size, a plot option, sets the font size of a legend’s entries, with the legend’s title one size larger. The default is 10. • :strip-labels, a plot option, sets what a facet strip prints: :value, the default, prints the category alone, and :both prints the column’s name before it, as drv: f. • :min-panel-size, a configuration key, is the smallest width and height a panel is drawn at. The default is 20.

Warnings and errors • The final map of a pj/lay-* call is called its mapping, as the final map of pj/pose is, and its keys that are not aesthetics, such as :stat and :bins, are called layer settings. No call changes its behaviour. pj/layer-option-docs is renamed pj/layer-mapping-docs, and layer-type/universal-layer-options is renamed layer-type/universal-mapping-keys; the old names are deprecated. • pj/overlay and :overlay, wherever written, warn that they are ignored, and report an error under :strict. (pj/overlay pose false) and {:overlay false} report an error naming pj/facet and pj/arrange. • Retired names warn, are read as their replacements, and report an error under :strict. :scales is read as the :share-scales it stands for, (pj/facet pose :drv :row) as (pj/facet pose {:row :drv}), and (pj/facet-grid pose :drv :cyl) as (pj/facet pose {:col :drv :row :cyl}). • pj/pose and lay-* given a vector of column pairs, such as [[:a :b] [:c :d]], report an error suggesting (pj/arrange data [{:x :a :y :b} {:x :c :y :d}]) or (pj/matrix data xs ys). pj/cross is deprecated: it warns and returns its pairs. pj/arrange given its cells one by one, (pj/arrange a b), reports an error. • A layer left without a column its layer type draws from reports an error naming the layer, the missing axis and the columns of the data. Drawing the pose reports the error, not building it, so a pj/lay-* call on data of four or more columns may leave its columns to a later step: (-> data pj/lay-point (pj/pose {:x :a :y :b})) draws. • A layer with no data draws a panel reading “no data” and prints a Note saying where to give the data, so a template can be drawn before pj/with-data gives it data. A cell of an arrangement that draws nothing prints a Note naming its row and column. • A lay-* call that adds a cell to an arrangement prints a Note where the new cell has no data, or where other cells draw nothing, naming the spelling that draws what was meant. • Under a facet over columns, a layer naming a column that is not among the facet’s reports an error where it would leave a panel without a layer drawing that panel’s column. A layer naming one of the facet’s columns prints a Note where another panel is left to the inferred layer type, saying how to draw the layer in every panel. • Layers of one pose that draw columns of different kinds on one axis, such as categories beside numbers, report an error naming pj/facet and pj/arrange. Layers that draw a count or a density beside a column’s values on one axis print a Note that the axis reads in two units. Numerical columns drawn on one axis print a Note where one of them takes less than a twentieth of the axis. • pj/facet reports an error when it is given a column the data does not hold, a facet in a direction already taken, or a map of columns on a composite. A key its map does not read reports an error naming where the key belongs. • A :where naming a column the data does not hold reports an error, and a value that appears nowhere in its column warns. • A :share-scales naming an axis that no two cells share warns, naming the columns the cells draw there. • The warning for a key a call does not read is worded pj/lay-point does not recognize [:foo], followed by where each key belongs. • A layer type given columns it cannot draw reports an error suggesting what can: pj/lay-bar given two categorical columns suggests counting one and colouring by the other, and pj/lay-histogram or pj/lay-density given two columns names both. pj/lay given a layer type that is neither registered nor a map naming its :mark reports an error. • Panels too small to draw report an error stating the size each panel would have and what the labels and legend take, and naming :width, :panel-width and :min-panel-size. For a facet, the error says that a facet does not wrap its panels and suggests pj/arrange. • pj/marginal reports an error for a key of its last map other than :size, and for a :size that is not a number between 0 and 1. • A grouped dataset, the result of tc/group-by, reports an error naming tc/ungroup. • A rule or a band given columns on a pose with one panel warns where the panel does not draw those columns, and ignores them; on a composite its columns pick the cell it is drawn in. • A line, step or area whose every group holds one row warns that it draws nothing visible. A smooth warns about the groups with too few rows to fit. • A message about a series names it by the columns written, not by the :value and :series columns it is pivoted into.

Fixed • Rotated x tick labels (`:x-tick-angle`) take at most 30% of the height of a plot or of a cell of an arrangement, so a scatter plot matrix can rotate them. • pj/lay-rug naming a column on :y alone, on a pose that has an :x, draws that column’s ticks along :y. • Brushing a faceted plot, or cells filtered with :where, highlights the same rows in every panel. A draft layer’s :data carries each row’s number in a :scicloj.plotje/row column. • A pose naming a column only on :y, under a layer type that draws from two columns such as lay-point, takes the first other column of data of one to three columns as its :x. • A series specified on a pose that no layer is added to is drawn, with an inferred layer or with the layers of the pose it is arranged into. • A fitted line, a density or a histogram grouped by one column and coloured by another, as in (pj/lay-smooth data :x :y {:group :a :color :b}), draws each group in the colour of its :b value. • Cells of an arrangement that share an axis end on one domain where their text labels widen it. A marginal covers the extent of its panel, also where a rule or a band widens the panel. • Facets that leave an axis out of :share-scales label the ticks of every panel whose axis differs from its neighbour’s. • A panel of a facet that holds no rows draws “no data” for every layer type, and the other panels are drawn. A facet of data with no rows draws one such panel. A panel whose categories are all missing adds no ? category to its axis. • A shape, size or alpha legend at :legend-position :top or :bottom is drawn, each in a row of its own under the colour legend. • A straight line fitted with {:stat :linear-model} is drawn inside the panel: the axis covers the ends of the line. • pj/arrange draws :subtitle under its title and :caption under the grid. • A layer placed in the drawing area, {:in :drawing-area}, with columns of its own data is drawn on the panel it is added to. • pj/facet reads a column name the data holds, of any type, so (pj/facet pose 2) on a dataset whose columns are integers draws a panel per value of column 2. • A scale spec’s :breaks, :tick-labels, :domain, :values and :range may be any ordered sequence, such as a dtype-next column, and a :domain written high to low holds the :breaks between its ends. • lay-* given columns and a scale for one of them in its map, as in (pj/lay-point data :a :b {:x {:scale :log}}), draws column :a on a log scale. • :share-scales written at the top of a hand-written pose map is read on a single pose, as it is on a composite. • pj/save writes a pose whose only data is a layer’s, and pj/svg-summary given data summarizes the plot pj/plot draws.

Book and project • The book’s plots scale to the width of the page. (PR #60) - thanks, @timothypratley • Plotje has an icon: the README’s logo and the book’s browser-tab icon. (PR #62) - thanks, @timothypratley

I added an emoji here for it, based on that logo: plotje

Thanks! 🙂