Fancy graphics #1 Force-directed diagrams Philippe Van Kerm University of Luxembourg and LISER 2020 e-London Stata user group meeting September 11, 2020
[ Outline ] Examples Principles and mechanics Implementation
Examples Principles and mechanics Implementation
My starting point... a: AGRCULTURE, FORESTRY, FISHERY b-e: MINING AND QUARRYING/MANUFACTURING/ELECTRICITY GAS STEAM AIR CONDITIONING SUPPLY/WATER SUPPLY; (+ OTHER INDUSTRIES) f: CONSTRUCTION g: WHOLESALE AND RETAIL TRADE; REPAIR OF MOTOR VEHICLES AND MOTORCYCLES h: TRANSPOT AND STORAGE i: ACCOMMODATION AND FOOD SERVICE ACTIVITIES j: INFROMATION AND COMMUNICATION k: FINANCIAL AND INSURANCE ACTIVITIES l-n: REAL ESTATE ACTIVITIES, PROFESSIONAL SCIENTIFIC AND TECHNICAL ACTIVITIES/ADMINISTRATIVE AND SUPPORT SERVICE ACTIVITIES o: PUBLIC ADMINISTRATION AND DEFENCE; COMPULSORY SOCIAL SECURITY p: EDUCATION q: HUMAN HEALTH AND SOCIAL WORK ACTIVITIES r - u: R-U:ARTS ENTERTAINMENT AND RECREATION/OTHER SERVICE ACTIVITIES/ACTIVITIES OF HOUSEHOLDS AS EMPLOYERS; (+ FEW OTHERS) a b - e f g h i j k l - n o p q r - u
Network visualisation (as a force-directed diagram) Economic sectors in the bedroom – The matrix is a network 7 – Each sector is a node 13 – Sectors with strong ‘bedroom 2 4 association’ located near each other 6 3 10 9 – (See Thomas Grund’s ♥✇❝♦♠♠❛♥❞s 12 8 for serious network analysis with 1 Stata; Corten (SJ, 2011), Miura (SJ, 5 2012).) 11
Network visualisation (as a force-directed diagram) Economic sectors in the bedroom – The matrix is a network 7 – Each sector is a node 13 6 – Sectors with strong ‘bedroom 4 3 association’ located near each other 2 10 9 – (See Thomas Grund’s ♥✇❝♦♠♠❛♥❞s 12 8 1 for serious network analysis with Stata; Corten (SJ, 2011), Miura (SJ, 5 2012).) 11
Another network visualisation (as a force-directed diagram) Echternach Vianden Diekirch Grevenmacher Clervaux Mersch Wiltz Remich Redange Luxembourg Capellen Esch
Another network visualisation (as a force-directed diagram) Echternach Vianden Diekirch Grevenmacher Clervaux Mersch Wiltz Remich Redange Luxembourg Capellen Esch
Another network visualisation package in the making � � � � ❢❞♥❡t❣r❛♣❤ varname if in ✱ ❧✐♥❦s✭ fromvar tovar Echternach Vianden � [strengthvar] ✮ s❤♦✇❧✐♥❦s✭✳✳✳✮ ✈❛r❝♦❧♦r✭✈❛r♥❛♠❡✮ Diekirch Grevenmacher Clervaux � ✳✳✳ Wiltz Mersch Remich Redange Luxembourg (too many options to discuss here (fiddling with the Capellen construction and display options; see below)) Esch
Other force-directed diagrams: ‘beeswarm’ plots Worried about the economy?
Other force-directed diagrams: ‘beeswarm’ plots Worried about the economy? Worried about the economy in general? Not at all (left) A lot (right)
Other force-directed diagrams: ‘beeswarm’ plots Worried your own finances? Worried about Your own financial situation? Not at all (left) A lot (right)
Other force-directed diagrams: ‘beeswarm’ plots Worried your health? Worried about your own health? Not at all (left) A lot (right)
Other force-directed diagrams: ‘beeswarm’ plots Worried about your friend and family’s health? Worried about health of friends and family? Not at all (left) A lot (right)
Variations on the same theme: other ‘beeswarm’ plots February ... The evolution of employment: telework, short-time employment, ‘parental’ leave, sick leave, job loss February early April June
Variations on the same theme: other ‘beeswarm’ plots April ... The evolution of employment: telework, short-time employment, ‘parental’ leave, sick leave, job loss February early April June
Variations on the same theme: other ‘beeswarm’ plots end May / early June ... The evolution of employment: telework, short-time employment, ‘parental’ leave, sick leave, job loss February early April June
A beeswarm plot package in the making April ... � � � � ❜❡❡s✇❛r♠ ❬ varname ❪ if in ✱ � � ✳✳✳✈❛r❝♦❧♦r✭✈❛r♥❛♠❡✮ ✈❛rs②♠❜♦❧✭✈❛r♥❛♠❡✮✳✳✳ (too many options to discuss here (fiddling with the construction, the display, the choice of locations etc.; see below))
What is the commonality? April ... Echternach Vianden Diekirch Grevenmacher Clervaux Wiltz Mersch Remich Redange Luxembourg Capellen Esch
What is the commonality? April ... – Simple scatterplots... – ... but elements have no pre-defined location on the canvas – Key to the drawing is calculating the plotting positions!
Examples Principles and mechanics Implementation
Force-directed layouts – Element positions determined by a stochastic simulation algorithm – Elements “interact” with each other in order to find their position on the canvas – Interactions through combinations of few simple forces: » Gravitational forces (positive or negative; attractions or repulsion) » Spring forces (towards target distances) » Collisions – Start from random positions and iterate until convergence to a stable plot – Stochastic: randomness in the resulting plot (set your s❡❡❞ )!
Force-directed layouts – Element positions determined by a stochastic simulation algorithm – Elements “interact” with each other in order to find their position on the canvas – Interactions through combinations of few simple forces: » Gravitational forces (positive or negative; attractions or repulsion) » Spring forces (towards target distances) » Collisions – Start from random positions and iterate until convergence to a stable plot – Stochastic: randomness in the resulting plot (set your s❡❡❞ )!
Force-directed layouts – Element positions determined by a stochastic simulation algorithm – Elements “interact” with each other in order to find their position on the canvas – Interactions through combinations of few simple forces: » Gravitational forces (positive or negative; attractions or repulsion) » Spring forces (towards target distances) » Collisions – Start from random positions and iterate until convergence to a stable plot – Stochastic: randomness in the resulting plot (set your s❡❡❞ )!
Different combination of forces lead to different types of plots Attraction forces between points and Spring forces to target connected node towards ‘anchors’ (hives) + collisions distances and repulsion April ... Echternach Vianden Diekirch Grevenmacher Clervaux Wiltz Mersch Remich Redange Luxembourg Capellen Esch
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Example for a beeswarm plot Positioning trail
Examples Principles and mechanics Implementation
Recommend
More recommend