Function Repository Resource:

LondonUndergroundMap

Source Notebook

Create customizable maps of the London Underground train routes

Contributed by: Jon McLoone

ResourceFunction["LondonUndergroundMap"][]

display a map of the London Underground system.

ResourceFunction["LondonUndergroundMap"][{line1,line2,}]

display a map of the named lines of the London Underground system.

Details and Options

All options for GeoGraphics are supported as well as the additional options:
"LineStyle"Automaticstyles to display the underground lines
"ShowStations"Falsedisplay locations of stations
"StationScale"Automaticthe size of station markers
"StationMarker"the symbol used to display stations
This implementation does not support the new Elizabeth line and stations from some branched lines are not included.

Examples

Basic Examples (3) 

Show the full map of the London Underground:

In[1]:=
ResourceFunction["LondonUndergroundMap"][]
Out[1]=

Show only the central London area:

In[2]:=
ResourceFunction["LondonUndergroundMap"][
 GeoCenter -> GeoPosition[{51.51316, -0.13358}], GeoRange -> Quantity[3, "Miles"]]
Out[2]=

You can display only specific lines. Choose from "Victoria", "Piccadilly", "District", "Circle", "Hammersmith & City", "Metropolitan", "Central", "Jubilee", "DLR", "Bakerloo", "Northern" and "Waterloo & City":

In[3]:=
ResourceFunction["LondonUndergroundMap"][{"Victoria"}, GeoCenter -> GeoPosition[{51.51316, -0.13358}], GeoRange -> Quantity[3, "Miles"]]
Out[3]=

Options (3) 

All options for GeoGraphics are supported:

In[4]:=
ResourceFunction["LondonUndergroundMap"]["Piccadilly", GeoCenter -> Entity["Airport", "EGLL"], GeoRange -> Quantity[1, "Miles"], GeoBackground -> "VectorClassic"]
Out[4]=
In[5]:=
ResourceFunction["LondonUndergroundMap"]["Piccadilly", GeoCenter -> Entity["Airport", "EGLL"], GeoRange -> Quantity[0.7, "Miles"], GeoBackground -> "Satellite"]
Out[5]=

By default, lines are styled with their traditional colors but can be styled collectively:

In[6]:=
ResourceFunction["LondonUndergroundMap"][All, "LineStyle" -> Directive[Thick, Black]]
Out[6]=

And they can be styled individually:

In[7]:=
ResourceFunction["LondonUndergroundMap"][{"Circle", "Piccadilly"}, "LineStyle" -> <|"Circle" -> Directive[Thick, Dashed], "Piccadilly" -> Directive[Thick, Red]|>]
Out[7]=

You can display the locations of stations on most lines:

In[8]:=
ResourceFunction["LondonUndergroundMap"]["Bakerloo", "LineStyle" -> Directive[Thick, Black], "ShowStations" -> True]
Out[8]=

With default markers:

In[9]:=
ResourceFunction["LondonUndergroundMap"]["Bakerloo", "LineStyle" -> Directive[Thick, Black], "ShowStations" -> True, "StationMarker" -> Automatic, "StationScale" -> 0.008]
Out[9]=

Neat Examples (1) 

Create a map of each line:

In[10]:=
Multicolumn[
 Labeled[ResourceFunction["LondonUndergroundMap"][#, "LineStyle" -> Black], #] & /@ {"Victoria", "Piccadilly", "District", "Circle", "Hammersmith & City", "Metropolitan", "Central", "Jubilee", "DLR", "Bakerloo", "Northern", "Waterloo & City"}, 4]
Out[10]=

Publisher

Jon McLoone

Version History

  • 1.0.0 – 16 November 2021

Related Resources

License Information