MatPlotLibNet.Geo 1.25.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package MatPlotLibNet.Geo --version 1.25.0
                    
NuGet\Install-Package MatPlotLibNet.Geo -Version 1.25.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MatPlotLibNet.Geo" Version="1.25.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MatPlotLibNet.Geo" Version="1.25.0" />
                    
Directory.Packages.props
<PackageReference Include="MatPlotLibNet.Geo" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MatPlotLibNet.Geo --version 1.25.0
                    
#r "nuget: MatPlotLibNet.Geo, 1.25.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MatPlotLibNet.Geo@1.25.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MatPlotLibNet.Geo&version=1.25.0
                    
Install as a Cake Addin
#tool nuget:?package=MatPlotLibNet.Geo&version=1.25.0
                    
Install as a Cake Tool

MatPlotLibNet.Geo

MatPlotLibNet.Geo adds geographic projections and maps to MatPlotLibNet: coastlines, borders, filled land and ocean, countries coloured by a value, places, bubbles, hexagon bins, flows and cartograms.

Quick Start

using MatPlotLibNet;
using MatPlotLibNet.Geo;
using MatPlotLibNet.Geo.Projections;

Plt.Create()
    .AddSubPlot(1, 1, 1, ax => ax
        .WithProjection(GeoProjection.Robinson)
        .Coastlines()
        .Borders())
    .Save("world_map.svg");

A map axes has one projection. WithProjection records it and every layer reads it, so Land(color), Ocean(color), Borders() and Coastlines() need no projection of their own. A layer asked for before the axes has a projection is refused with "call WithProjection first", and a layer that is given a projection has to give the axes' own (the same kind with the same numbers) or it is refused with an ArgumentException naming both.

A map coloured by a value

Choropleth colours each country by a value through a colour map. The values are joined to the built-in countries by their three-letter code (ADM0_A3), or Choropleth("POP_EST") reads a numeric property of the features:

using MatPlotLibNet;
using MatPlotLibNet.Geo;
using MatPlotLibNet.Geo.Projections;
using MatPlotLibNet.Styling.ColorMaps;

var populationMillions = new Dictionary<string, double> { ["FRA"] = 68, ["DEU"] = 84, ["ESP"] = 48 };

Plt.Create()
    .AddSubPlot(1, 1, 1, ax => ax
        .WithProjection(GeoProjection.Robinson)
        .Choropleth(populationMillions, ColorMaps.Viridis)
        .WithColorBar())
    .Save("choropleth.svg");

A country with no value is drawn in the colour map's bad colour, and the colour bar reads the range of the values that can be drawn.

Data on a map

Verb Draws
Points(latitudes, longitudes) a scatter of places
Bubbles(latitudes, longitudes, values) a bubble at each place, its area in proportion to its value
HexBins(latitudes, longitudes) hexagon bins in the plane of the map
Flows(flows, color, maxWidth) a line along the great circle for each GeoFlow, as wide as its quantity, cut where it crosses the antimeridian
Cartogram(values) each country resized so that its area is in proportion to its value, about its own centre
Dorling(values) a bubble at the centre of each country

A place the projection cannot place, such as the far side of an orthographic globe, is left out.

A map in JSON

A figure that holds a map comes back from JSON whole: the series writes its projection (its kind and the numbers it was made with), its features (the id of the built-in set, or a GeoJSON FeatureCollection with the holes kept), and its values, colour map and normaliser. The package registers the reader when it loads; a process that reads such JSON before it has used any type of this package calls GeoPolygonSeries.RegisterReader() once. A 1.23.0 reader leaves the map out with the diagnostic for a series kind it does not know.

Projections

Projection Use case
PlateCarree Simplest, identity mapping
Mercator Web maps, navigation
Robinson World maps (compromise)
Orthographic Globe view
LambertConformal Mid-latitude regions (US, Europe)

The package ships 13 projections; the cookbook page lists them all and shows every layer with a picture.

Data

The package embeds Natural Earth data at 110m resolution:

  • Coastlines (~50KB)
  • Country borders (~150KB)

The data comes from Natural Earth and is public domain.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.27.0 0 10/30/2026
1.26.0 0 10/30/2026
1.25.0 0 10/29/2026
1.24.0 40 10/29/2026
1.23.0 91 10/27/2026
1.22.0 112 10/24/2026
1.21.0 102 10/23/2026
1.20.0 91 10/22/2026
1.19.0 102 10/21/2026
1.18.2 98 10/18/2026
1.18.1 90 10/12/2026
1.18.0 113 9/23/2026
1.17.1 111 9/13/2026
1.17.0 123 9/12/2026
1.16.0 113 9/12/2026
1.15.1 107 9/12/2026
1.15.0 116 9/11/2026
1.14.4 111 9/11/2026
1.14.3 136 8/30/2026
1.14.2 130 8/17/2026
Loading failed

MatPlotLibNet 1.25.0. What changed in this release, and in every release before it, is written out in the changelog: https://github.com/xkqg/MatPlotLibNet/blob/main/CHANGELOG.md#1250