Marey.Plot
0.5.0
See the version list below for details.
dotnet add package Marey.Plot --version 0.5.0
NuGet\Install-Package Marey.Plot -Version 0.5.0
<PackageReference Include="Marey.Plot" Version="0.5.0" />
<PackageVersion Include="Marey.Plot" Version="0.5.0" />
<PackageReference Include="Marey.Plot" />
paket add Marey.Plot --version 0.5.0
#r "nuget: Marey.Plot, 0.5.0"
#:package Marey.Plot@0.5.0
#addin nuget:?package=Marey.Plot&version=0.5.0
#tool nuget:?package=Marey.Plot&version=0.5.0
Marey.Plot
The chart API of Marey, a dimensionally-typed visualization system for F#. This is the package most people install.
#r "nuget: Marey.Plot"
#r "nuget: Marey.Backend.Svg"
open Marey
open Marey.UnitsOfMeasure
let t = Array.init 24 (fun i -> float i * 0.4<s>)
let x = t |> Array.map (fun t -> 0.5 * 9.81<m/s^2> * t * t)
Chart.line U.second U.metre t x
|> Chart.withTitle "Free fall"
|> Chart.toSvg SvgBackend.render "fall.svg" (Chart.size 800.0 500.0)
That prints an x axis reading t [s] and a y axis reading x [m] with nothing configured.
The scale, the domain, the SI prefix, the tick values, the tick labels and both axis titles are
derived from the two unit witnesses. x is never annotated as a length — the compiler works that
out — and plotting metres against metres on these axes is a compile error.
What is in it
Chart— twelve geoms:line,scatter,area,bar,errorbar,step,ribbon,tile,rect,image,segmentandtext, with box plots and violins by category underChart.Category. Two modes: underopen Marey.UnitsOfMeasureeach takes a witness per axis, checked at compile time, and most have anadd*that layers onto the last panel; underopen Mareyalone,Chart.Line(xs, ys, yUnit = U.metre)takes plain arrays and units that may be left out, andChart.addlayers any figure onto another.The
plotencoding block — for data that is a table rather than two arrays. Declares x, y, colour, shape and size in one place, with each dimensioned channel checked against its witness; withoutMarey.UnitsOfMeasure, a channel may also leave its witness out.C#. Extension methods on
Figureand theCategory,Figuresand renderer-delegate doors, in theMarey.CSharpnamespace.Channels. One colour or marker shape per category, with a legend that names the levels; or a colour or size driven by a quantity, which brings a colorbar labelled from its unit witness.
Statistics — histogram, kernel density, ECDF, least-squares fit, and a five-number summary. The measures carry through: a fit of metres against seconds has a slope of type
float<m/s>.Facets.
facetWrapgives one panel per level of a key, over shared axes.Themes. Six, all measured against the colour validator below.
Theme.tikzinherits the host LaTeX document's fonts.Palettes — Okabe–Ito, viridis, cividis, magma and an Oklab diverging ramp, with a colour-vision-deficiency and contrast validator that every shipped theme is checked against.
A measure–arrange constraint layout, and the axis and legend compilers.
The
scenestoryboard block, for a figure that moves:open Marey.Storyboard let intro = scene { let! curve = draw measured |> over 1.2<s> do! wait 0.5<s> do! parallel' [ curve |> morphTo fitted |> over 2.0<s> curve |> zoomToX (0.0, 8.0) |> over 2.0<s> ] do! highlight curve.[42] } let anim = animate 32 (Chart.size 640.0 400.0) introlet!binds a name for something on stage;animatelays the whole shot out once, against the union of every state it sampled, so the panel holds still while the data moves. Seeking is evaluation, soanim.At 2.7<s>is a direct call and frames render in any order, in parallel.The frame writer.
Film.ofStorypairs the scene animation with the layout it is drawn inside, andFrames.writerenders every frame overArray.Parallel.mapand numbers them onto disk asframe-00000.png. The concurrent and serial passes produce the same bytes in the same order, and one memoisedITextMeasurerserves the whole film — because font resolution walks a family stack against whatever is installed, and a measurer per thread is a chance for one frame of a video to be set in a different typeface from the frame before it.Per-layer styling that survives a theme change where it was set explicitly and is recoloured where it was not, which is what makes
withThemesafe to apply last.
No backend reference
Marey.Plot does not depend on a renderer. A backend is a function passed in at render time,
which is why the same figure goes to SVG or to LaTeX without the figure knowing either exists.
Install one:
Marey.Backend.Svg— pure F#, zero dependencies.Marey.Backend.Tikz—tikzpicturesource for LaTeX, withsiunitxunits.
Depends on Marey.Core,
Marey.Units and
Marey.Anim — the last because the storyboard names
an Anim and a Figure in one signature. It is 36 KB and has no dependencies of its own.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- FSharp.Core (>= 10.1.401)
- Marey.Anim (>= 0.5.0)
- Marey.Core (>= 0.5.0)
- Marey.Units (>= 0.5.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Marey.Plot:
| Package | Downloads |
|---|---|
|
Marey.Html
HTML renderings of Marey values for notebooks: figures and scenes as inline SVG, colours as swatches, ramps resampled through Oklab, palettes, dimensions, unit witnesses and erased scales, and a live figure's page. Host-neutral and dependency-free. |
|
|
Marey.Tools.Video
Encode a rendered frame sequence to video by shelling out to ffmpeg. Degrades to the numbered frames when ffmpeg is absent. |
|
|
Marey.Interact
Interaction for Marey: typed controls (a slider over kelvin hands the view kelvin, and labels itself in them), composed into a live figure by an applicative block, and stepped by a pure function a notebook host drives: controls, zoom, pan, a readout in the axes' units, and recordings that replay as films. |
|
|
Marey.Fields
Fields for Marey: scalar and vector fields on dimensioned planes, sampled onto grids, with gradient, divergence, curl and the Jacobian in the units the types work out. A phase space with a different unit on each axis is a first-class domain. |
GitHub repositories
This package is not used by any popular GitHub repositories.