All examples
Visualization

Compare Mexico and Canada offline

Join synthetic values to Mexican federal entities and Canadian provinces or territories, then focus on Mexico City and Ontario.

plot_americas.aner
// Requires the updated native development runtime and the mexico/canada packs.
// Install the matching local .anermap files before running offline.
// Values are synthetic. Boundaries: generalized Natural Earth 1:10m, 2022 snapshot.
import aner.plot

let mexico = plot.map("mexico",
    keys: List("MX-DIF", "MX-JAL", "MX-NLE"), values: List(8.0, 12.0, 10.0))
mexico.projection("albers")
    .title("Mexico: synthetic federal-entity values")
    .caption("Natural Earth 2022 snapshot; 32 named entities; unassigned offshore pseudo-unit excluded.")
    .show()

// Preserve the pinned source key/name; MX-DIF is a legacy code for Mexico City.
mexico.focus("MX-DIF").projection("lambert_azimuthal_equal_area")
    .title("Mexico City: federal-entity boundary")
    .caption("Synthetic index; source key MX-DIF, source label Distrito Federal; no municipality or street layer.")
    .show()

let canada = plot.map("canada",
    keys: List("CA-BC", "CA-ON", "CA-QC"), values: List(9.0, 14.0, 11.0))
canada.projection("albers")
    .title("Canada: synthetic provincial values")
    .caption("Natural Earth 2022 snapshot; all 10 provinces and 3 territories; missing values have no data.")
    .show()

canada.focus("CA-ON").projection("lambert_azimuthal_equal_area")
    .title("Ontario: focused provincial extent")
    .caption("Synthetic index; generalized provincial boundary; focus retains the full chart color range.")
    .show()

// These spherical display projections do not transform coordinates for analysis.
// Country subdivisions remain distinct from municipalities, cities and street maps.

Run step by step in VS Code.

The notebook separates observations and chart construction into cells. It opens with empty outputs and shared variables. Map cells state which optional local packs they need.

  1. Install a compatible native Aner executable and VS Code extension using the editor guide. Chart construction and interactive geographic navigation require the matching development runtime and editor.
  2. Download the .anernb notebook and open it in your VS Code project. If it appears as JSON, choose Reopen Editor With… → Aner Notebook.
  3. Select the Aner — notebook kernel and keep Shared variables active. Run code cells from top to bottom, or choose Run All. Later cells reuse observations and chart values from earlier cells. Run cells that need no pack before trying the optional geographic map.
  4. Read the figures below their producing cells. In geographic outputs, drag to pan and use the zoom controls to reveal crowded labels. Static SVG exports retain the initial view. Source observations, units and limitations remain in each caption.

After changing an earlier cell, rerun its dependent cells. Use Aner: Restart Notebook Session, then Run All, for a clean experiment. Saved outputs are historical; reopening the file starts without live variables. The notebook guide explains session state, inspection, and runtime controls.

Make it your experiment.

With a compatible development runtime installed, save this program as examples/plot_americas.aner inside a folder for your experiment. Open a terminal in that folder, then check and run the program.

Terminal
aner check examples/plot_americas.aner
aner run examples/plot_americas.aner

The aner command must be on your PATH. Follow the installation guide if your terminal cannot find it.

Requires a chart enabled native Aner development runtime and a matching VS Code extension for notebook display and interactive geographic navigation. Aner Plot awaits a binary release and is not included in the published research preview. Development packages are not available on this website. Copy the required matching .anermap files to the computer and install them locally. Install mexico and canada before running the complete source. All observations are included, and execution requires no network, credentials or external service. The website shows static native SVG figures; pan and zoom run in the compatible local notebook renderer.

Map pack status
aner maps list
aner maps path

Observations are synthetic teaching inputs. Geographic context comes from optional offline boundary packs and does not add street detail or establish observed traffic conditions.

Read the chart and map contracts
Install Aner