Next Article in Journal
Reflectance Transformation Imaging as a Tool for Computer-Aided Visual Inspection
Previous Article in Journal
Research on Adhesive Coefficient of Rubber Wheel Crawler on Wet Tilted Photovoltaic Panel
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Spiral Strip

Faculty of Mathematics and Physics, University of Ljubljana, Jadranska Cesta 19, 1000 Ljubljana, Slovenia
Appl. Sci. 2022, 12(13), 6609; https://doi.org/10.3390/app12136609
Submission received: 19 May 2022 / Revised: 21 June 2022 / Accepted: 28 June 2022 / Published: 29 June 2022
(This article belongs to the Section Earth Sciences)

Abstract

:
A visual graphic called Spiral Strip is presented consisting of color-coded segments arranged in a spiral. The width and length of each individual segment can be different, which can be used to convey additional information (besides the color coding). Although the primary motivation for developing the new graphic was related to climatic data, it can also be used with other types of data. Several examples based on climatic, population-size, and historical data are used to show the graphic’s visual appearance and main properties. The examples also demonstrate how the meaning of the graphic can be easy to grasp and intuitively understood by a casual observer. An easy-to-use Python code package for drawing the Spiral Strips was published in a public repository.

1. Introduction

In the field of climate change, there is a great need to provide effective visual material that shows the changes in the environment that are already happening or will be happening, which would be easy to grasp and intuitively understood by the majority of the general public. One excellent example of such material is the warming stripes infographic (sometimes also referred to as climate stripes, climate timelines, or stripe graphics) designed and published by University of Reading climate scientist Ed Hawkings in 2019 [1]. The warming stripe features a very minimalistic rectangular design consisting of narrow color-coded vertical segments (stripes) arranged horizontally from left to right showing a temporal sequence of temperatures. The colder temperatures are represented by blue shades, while red shades represent warmer temperatures. This typically results in a nonmonotonic color transition from blue to red, clearly showing the warming trend of Earth’s climate and the inherent variability of the climate system. The meaning of the graphic is very easy to grasp and can be intuitively understood by a casual observer. The author later created a website, showyourstipes.info (accessed on 1 May 2022) where stripe images can be generated for many regions around the globe. The images have been downloaded more than a million times, have been widely shared online, and are used to decorate ties, cufflinks, and cars [1].
Here, we present a new type of visual graphic we call a Spiral Strip. Its design is loosely based on the warming stripe, but instead of a horizontal geometry, the color-coded segments are arranged in an Archimedean spiral [2]. With spiral geometry, the length of individual segment can be larger compared to the warming stripe, facilitating displaying a longer series, and providing more textual and numerical information along each segment. The new graphic is more square, whereas the warming stripe typically has a larger horizontal dimension than the vertical. The spiral can also start some way off the center, leaving the central region empty, so a title or supporting text can be added in the middle. The width and length of each segment can be different, which can be used to convey additional information (in addition to the one shown by the color-coding).
There have been multiple previous attempts to use spiral geometry to visualize data. One of the earliest examples can be found in [3], where a line-type graph in spiral geometry was used to visualize a time series data.
The authors in [4] used a 3D spiral for calendar visualization, while in [5], the authors tried various approaches with spiral visualization, including displaying data in various forms in 3D. In [6] the authors tested various spiral-geometry-based approaches to visualize time series data, with a special focus on enhancing the identification of periodic patterns. They tested various approaches, such as changing the visual appearance of the spiral, drawing multiple spirals, and displaying them all together or sequentially in animation, using interaction techniques, or displaying it in 3D as a helix. The authors in [7] presented a tool for fixed-width spiral track visualization based on a two-tone pseudocoloring approach. Quite recently, the authors in [8] presented a spiral visualization tool called spiralize, which is available as a R package. The tool supports the visualization of multiple fixed-width tracks running along the spiral, where each track serves as an independent plotting region, thereby allowing for building very complex graphics.
Our focus was the development of a graphic that would not be too complex and could thus be intuitively understood by a casual observer. Our aim was also to publish a freely available Python software package that would be easy to use by the users to draw their own spiral strip images. While some other tools, such as the spiralize package, already exist, they do not offer the complete set of functionalities we were trying to implement. For example, they are based on fixed-width strips, while we wanted to implement strips with variable width to potentially convey additional information. Moreover, all existing approaches seem to rely solely on polar geometry to define the shapes representing the individual segments, that is, the two straight boundaries at the start and finish of each segment are defined to be parallel with the r axis of the polar coordinate system. However, since the Archimedean spiral curve is not perpendicular to the r axis, the segments can look deformed and skewed, and the result is less visually appealing. This is especially noticeable near the center, where the deformation is most apparent, or when the segments are narrow (when the width of individual segments is significantly larger than their length). The relatively large deformation near the center is probably why the segments in such graphics tend to not start at the center but some way off, leaving the middle region empty. Here, we took a different approach by defining a custom coordinate system where one axis is always parallel to the spiral curve, while the other axis is always perpendicular. We could then use this coordinate system to define the shapes of segments that were less deformed and looked more acceptable, especially near the center.
Section 2 explains the details of the design of the new graphic, and Section 3 shows some examples highlighting its properties. Lastly, Section 4 provides the conclusions.

2. Methodology

2.1. Spiral Strip Design

We start by defining the spiral with
r = a + b φ / 2 π ,
where r represents the distance from the center of the polar coordinate system. φ is a variable with values between zero, representing the start of the spiral, and some maximal value, representing the spiral endpoint. The expression in Equation (1) represents an Archimedean spiral, since r increases linearly with φ . An increase in φ for 2 π represents one spiral loop. a and b are two parameters, with a representing the distance of the spiral starting point from the center, and b the radial distance between consecutive loops of the spiral (Figure 1a).
In the Cartesian coordinate system, the spiral curve can be expressed as
x = r cos φ + φ 0 ,
y = r sin φ + φ 0 ,
with φ 0 being an additional parameter representing the angle between the x axis and line that links the center, and the spiral staring point (Figure 1a).
A small change in φ , which we denote as d φ , causes small changes in the x and y coordinates. These changes can be expressed from Equations (2) and (3) with the use of total derivatives, which yields
d x = b cos φ + φ 0 2 π a + b φ sin φ + φ 0 2 π d φ ,
d y = b sin φ + φ 0 + 2 π a + b φ cos φ + φ 0 2 π d φ .
The length of a small spiral segment d l that corresponds to d φ can be expressed as
d l = d x 2 + d y 2 = d φ a 2 + a b φ π + b 2 φ 2 + 1 4 π 2
This equation can be reversed to obtain the change in φ if one would move a short distance along the spiral (represented by d l )
d φ = d l a 2 + a b φ π + b 2 φ 2 + 1 4 π 2 1 2
The polar coordinate system can be used to define the geometric shapes of individual segments. In this case, the two straight borders of each segment can be parallel with the r axis of the polar coordinate system, while the two other curved borders can be along Archimedean spirals. However, the visual inspection of such spiral strips highlighted some problems—the segments can look deformed, especially near the center of the spiral, and the result is less visually appealing. This prompted us to define a new coordinate system where one axis is always parallel to the spiral curve while the other is always perpendicular. The segments looked less deformed in the new coordinate system, and the result was more visually appealing. A comparison of results from both coordinate systems is available in the Supplementary Materials.
The custom coordinate system can be represented by a set of two basis vectors that change along the spiral. The basis vector that points along the spiral curve ( e l ) can be expressed as
e l = 1 d l d x d y = b cos φ + φ 0 2 π a + b φ sin φ + φ 0 2 π a 2 + a b φ π + b 2 φ 2 + 1 4 π 2 b sin φ + φ 0 + 2 π a + b φ cos φ + φ 0 2 π a 2 + a b φ π + b 2 φ 2 + 1 4 π 2
The basis vector that points perpendicularly to the spiral curve ( e p ) can be expressed as
e p = 1 d l d y d x = b sin φ + φ 0 + 2 π a + b φ cos φ + φ 0 2 π a 2 + a b φ π + b 2 φ 2 + 1 4 π 2 b cos φ + φ 0 2 π a + b φ sin φ + φ 0 2 π a 2 + a b φ π + b 2 φ 2 + 1 4 π 2
Figure 1b shows the resulting shape of individual segments that are arranged along the spiral. The width and length of the segments are denoted by w and l. For simplicity, all segments shown in Figure 1b had the same width and length, but the width and length of each segment can also be different (this is demonstrated by some of the examples shown in the next section).
The values of parameters a and b can be expressed with the use of segment width w as a = r 0 + w 2 and b = w + s . r 0 is the approximate distance of the first element from the center, while s represents the space (the width of the gap region) between the segments in two consequent loops (for details, please see the enlarged inset region in Figure 1b).
We used vector m = ( x , y ) to denote a point on the spiral, with x and y defined by Equations (2) and (3), respectively. For each m , we can define two additional vectors that point to two points on the opposite sides of the spiral:
p = m + w 2 e p ,
q = m w 2 e p .
The locations of points m , p , and q at the start of the spiral are shown in the enlarged inset region in Figure 1b (they are denoted as m 1 , p 1 and q 1 ). The distance between p and q is always equal to the width of the spiral segment, and the line that connects the two points is always perpendicular to the curve.
Each spiral segment is defined as a multipoint polygon defined by a sequence of p and q points. The drawing procedure begins at the spiral start point (which corresponds to φ = 0 ). First, the corresponding values of x , y and e p are calculated using Equations (2), (3), and (8) assuming φ = 0 . With these, the locations of corresponding p and q points are calculated via Equations (8) and (9).
Next, we move in small steps along the spiral curve. We denoted the length of each step as Δ l . The step size needs to be small enough; otherwise, the borders of the segments might not look smooth (e.g., at least 100 steps should be performed for each spiral loop). At each step, the new value of φ is calculated with the use of Equation (7) as
φ new = φ old + Δ l a 2 + a b φ old π + b 2 φ old 2 + 1 4 π 2 1 2 .
At each step, a new set of p and q points are calculated in the same way as before, but using φ new instead of φ = 0 . Once the length of the traveled path reaches the prescribed length of the segment (l), the list of all p and q points corresponding to this segment is used to draw a filled polygon with the prescribed color. This process is then repeated for all next segments.
The end result is a spiral strip consisting of segments with prescribed widths and lengths, with the segment borders guaranteed to be either parallel or perpendicular to the spiral curve.

2.2. Spiral Strip Python Package

We published a Python package that implements the procedure described in the previous section. The package is freely available in the Github repository (for details, please refer to the data availability statement at the end of the article). The package uses the widely available NumPy and Matplotlib python libraries to produce images in a vector (e.g., pdf, eps) or raster (e.g., png, gif, jpg) format. The package is easy to use, and has many options for customizing the graphic and some additional functionalities not mentioned in the previous section (e.g., the possibility of displaying textual or numerical annotations near each segment and adding gaps between consecutive segments). The package also includes the code and data for all the examples shown in the next section.

3. Results

Here, we show some examples of the new graphic. All the examples were drawn using the Spiral Strip Python package described in Section 2.2. The source code and the data for all examples are available in the package.
Figure 2 shows the first four examples that are based on the temperature data from Ljubljana, Slovenia. They all show a hundred-year sequence of average yearly 2-m temperatures in Ljubljana in the period of 1917–2017. The yearly averages were calculated from the monthly average temperature data in the same period, which the Slovenian Environment Agency kindly provided.
Figure 2a shows a rather thin spiral strip that makes approximately five and a half loops around the center from start to finish. The most recent year in the dataset (2017) is positioned at the start of the spiral near the center, while the first year (1917) is positioned at the other end of spiral. The spiral strip was drawn using the following parameter values: r 0 = 10 , φ 0 = 45 , w = 20 , l = 40 and s = 15 .
Matplotlib’s coolwarm color map, which includes a transition from blue to red, was used to define the segment colors. Similar to the warming stripes, the colder years are thus represented in more bluish colors and the warmer in more reddish. The coldest year was 1940, when the average temperature was only 8.4 °C, and the warmest year was 2014, with a temperature of 12.6 °C. Like the warming stripes, there is a color transition from the bluish colors at the outskirts of the spiral toward more reddish colors near the center, thus clearly showing the warming trend of Earth’s climate and the inherent variability of the climate system. As long as the observer knows that the colors reflect the temperatures, and that the time increases towards the middle, the meaning of the graphic is very easy to grasp and can be intuitively understood.
Figure 2b is identical to Figure 2a, with the exception that labels were added near each segment indicating the year. The orientation of the text is along vector e l . In order to keep the spiral strip the main focus of the graphic, the label font size is small, and the colors of the labels are identical to the colors of the corresponding polygons. An alternative option could be to display the yearly temperature values instead of the years, display both, or intermittently display the year and the temperature.
Figure 2c shows a strip with wider and shorter segments. Compared to the strips shown in Figure 2a, the segment width was increased from w = 20 to 30 and the length reduced from l = 40 to 10, with the rest of the parameters being the same. Due to the shorter segments, the spiral strip makes only two full loops around the center from start to finish. Similar to Figure 2b, the labels show the years in small font and are color-coded identically to the polygons in order for the spiral strip to remain the main focus of the graphic.
Figure 2d is similar to Figure 2a, but with the spiral strip starting some way off the center. The only parameter that changed compared to Figure 2a is r 0 , which was increased from 10 to 120. Since the spiral does not start near the center, the middle region is empty, allowing for adding a title. The title Ljubljana temperature was manually added to the image after it had been produced. The title clarifies for the casual observer what is shown on the graphic.
The last two examples are not related to climate. Figure 3 shows the increase in global population in the period of 1900–2021, with each segment representing one year. The image is based on the freely available population data published at ourworldindata.org (https://ourworldindata.org/world-population-growth (accessed on 30 January 2022 )). Their data are based on two sources, the UN World Population Prospects [9] and the Gapminder [10].
The population information is displayed by the color (again using the coolwarm colormap) and width of the segments. The following parameter values were used to draw the spiral strip: r 0 = 10 , φ 0 = 45 , l = 4.5 and s = 0 . The width of each segment was different and proportional to the population size. It is defined as w = p o p p o p max · 60 , where p o p is the population size for the corresponding year, while p o p max is the largest value of population in the series. The labels intermittently depict the year and population size, with the years shown in gray, while the population size uses a larger font and is colored identically to the polygons. The title Humans was manually added to the image after it had been produced.
The increasing width, along with the clear color transition from blue to red, clearly shows the increasing trend of the population on our planet, as the population increased from 1.7 to 7.9 billion between 1900 and 2021. The meaning of the graphic is easy to grasp and can be intuitively understood by a casual observer.
The last example shows the seven deadliest wars in human history (Figure 4). Information about the death toll and duration of the wars was taken from the Wikipedia page “List of wars by death toll” [11]. Only the data from the seven wars with the largest death toll were used. If the death toll for a particular war was given as a range, the middle value between the upper and lower estimates was used.
The wars are sorted according to the death toll in descending order. The following parameter values were used to draw the spiral strip: r 0 = 10 , φ 0 = 0 and s = 0 . The length of each segment is proportional to the duration of the corresponding war: l = 35 · d u r a t i o n where d u r a t i o n is expressed in years. The width of each segment is determined by the war’s duration and death toll: w = 10 · d e a t h s d u r a t i o n where d e a t h s are expressed in millions. The area size of each segment can be approximated by multiplying w with l. Since w · l = 10 · d e a t h s d u r a t i o n 35 · d u r a t i o n = 350 · d e a t h s it follows that the area size of each segments is approximately proportional to the death toll. As the length of the segment is proportional to the duration and its area size to the death toll, it is easy to compare the duration and death toll of different wars visually. The segment colors alternate between red and blue to make the segments more distinct. Since the segments were not part of a temporal sequence, a white gap was added between consecutive segments (the length of the gap is 20) to make the segments more distinct. Once the spiral strip had been drawn, the title and the annotations were manually added to the image.
Once the observer is aware that the length of each spiral segment is proportional to the war’s duration, and its area size to its death toll, the meaning of the graphic is easy to grasp. The tremendous death toll of World War II is very apparent, with its segment being much larger in terms of area than the segments of other wars are. The long duration of the Chinese Civil War also stands out, with the other segments being significantly shorter.

4. Conclusions

A visual graphic called Spiral Strip was presented that consists of color-coded segments arranged in a spiral. The width and length of each segment can be different, which can be used to convey additional information. A customized coordinate system was used to define the shapes of individual segments, which in turn look less deformed near the center.
Although the primary motivation for developing the new graphic was related to climatic data, it can also be used with other types of data. The graphic’s visual appearance and main properties were demonstrated in several examples based on climate, population size, and historical data. These show that, as long as the observer is aware of some minimal prior information, the meaning of the graphic is easy to grasp and can be intuitively understood. An easy-to-use Python code package for drawing the Spiral Strips is freely available for download in a public repository.

Supplementary Materials

The following are available online at https://www.mdpi.com/article/10.3390/app12136609/s1, Section S1 in includes a comparison of two coordinate systems that can be used to define the shapes of individual segments. Figure S1. Visual comparison of spiral strip examples that use two different coordinate systems. For the examples on the left side (a,c,e), the shape of segments is defined using the polar coordinate system. For the examples on the right side (b, d, f) the shape of segments is defined using the a custom coordinate system.

Funding

The authors acknowledge the financial support from the Slovenian Research Agency (Javna Agencija za Raziskovalno Dejavnost RS; research core funding no. P1-0188 and project J1-9431).

Data Availability Statement

A Python code package for creating Spiral Strip images is freely available on https://github.com/skokg/Spiral-strip (accessed on 18 May 2022) under a AGPL3 license.

Conflicts of Interest

The author declares no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.

References

  1. Kintisch, E. New Climate ‘Stripes’ Reveal How Much Hotter Your Hometown Has Gotten in the Past Century. 2019. Available online: https://www.science.org/content/article/new-climate-stripes-reveal-how-much-hotter-your-hometown-has-gotten-past-century (accessed on 1 February 2022). [CrossRef]
  2. Weisstein, E.W. “Archimedes’ Spiral” from MathWorld—A Wolfram Web Resource. Available online: https://mathworld.wolfram.com/ArchimedesSpiral.html (accessed on 1 February 2022).
  3. Bertin, J. Semiology of Graphics: Diagrams, Networks, Maps; University of Wisconsin Press: Madison, WI, USA, 1983; ISBN 978-0-299-09060-9. [Google Scholar]
  4. Mackinlay, J.D.; Robertson, G.G.; DeLine, R. Developing Calendar Visualizers for the Information Visualizer. In Proceedings of the 7th Annual ACM Symposium on User Interface Software and Technology, UIST’94, Marina del Rey, CA, USA, 2–4 November 1994; Association for Computing Machinery: New York, NY, USA, 1994; pp. 109–118. [Google Scholar] [CrossRef]
  5. Carlis, J.V.; Konstan, J.A. Interactive visualization of serial periodic data. In Proceedings of the 11th Annual ACM Symposium on User Interface Software and Technology—UIST’98, San Francisco, CA, USA, 1–4 November 1998; ACM Press: New York, NY, USA, 1998; pp. 29–38. [Google Scholar] [CrossRef]
  6. Weber, M.; Alexa, M.; Muller, W. Visualizing time-series on spirals. In Proceedings of the IEEE Symposium on Information Visualization, 2001. INFOVIS 2001, San Diego, CA, USA, 22–23 October 2001; pp. 7–13. [Google Scholar] [CrossRef]
  7. Tominski, C.; Schumann, H. Enhanced interactive spiral display. In Proceedings of the Annual SIGRAD Conference, Special Theme: Interactivity, Stockholm, Sweden, 27–28 November 2008; Linköping University Electronic Press: Stockholm, Sweden, 2008; p. 4. [Google Scholar]
  8. Gu, Z.; Hübschmann, D. spiralize: An R package for visualizing data on spirals. Bioinformatics 2022, 38, 1434–1436. [Google Scholar] [CrossRef]
  9. United Nations, Department of Economic and Social Affairs, Population Division. World Population Prospects 2019, Online Edition. Revision 1; UN: New York, NY, USA, 2022. [Google Scholar]
  10. Gapminder Population Dataset Version 6, Based on Data by Angus Maddison improved by CLIO INFRA. 2022. Available online: https://www.gapminder.org/data/documentation/gd003/ (accessed on 1 February 2022).
  11. Wikipedia. List of Wars by Death Toll. Available online: https://en.wikipedia.org/wiki/List_of_wars_by_death_toll (accessed on 1 February 2022).
Figure 1. Design of the spiral strip graphic. (a) Spiral curve (thick line) defined by Equations (2) and (3) shown in a Cartesian coordinate system denoted by the x and y axes. Dashed circles represent the distance to the center of the coordinate system. (b) Similar to (a), but with individual segments shown along the spiral. The segment’s width is denoted by w and the length by l. The inset area in the middle shows a more detailed view of the region denoted by the square.
Figure 1. Design of the spiral strip graphic. (a) Spiral curve (thick line) defined by Equations (2) and (3) shown in a Cartesian coordinate system denoted by the x and y axes. Dashed circles represent the distance to the center of the coordinate system. (b) Similar to (a), but with individual segments shown along the spiral. The segment’s width is denoted by w and the length by l. The inset area in the middle shows a more detailed view of the region denoted by the square.
Applsci 12 06609 g001
Figure 2. Four spiral strips all showing a hundred years of average yearly 2-m temperatures in Ljubljana in the period of 1917–2017. The colder years are represented in more bluish colors, and the warmer in more reddish. The time in all strips increases towards the center of the spiral. (a) shows a rather thin spiral strip that makes approximately five and a half loops around the center. (b) is identical to (a), except that labels were added near each segment indicating the year. (c) shows a strip with wider and shorter segments. (d) is similar to (a), except with the spiral strip starting some way off the center, and a label was added. For a more detailed description and discussion of examples, please refer to the text.
Figure 2. Four spiral strips all showing a hundred years of average yearly 2-m temperatures in Ljubljana in the period of 1917–2017. The colder years are represented in more bluish colors, and the warmer in more reddish. The time in all strips increases towards the center of the spiral. (a) shows a rather thin spiral strip that makes approximately five and a half loops around the center. (b) is identical to (a), except that labels were added near each segment indicating the year. (c) shows a strip with wider and shorter segments. (d) is similar to (a), except with the spiral strip starting some way off the center, and a label was added. For a more detailed description and discussion of examples, please refer to the text.
Applsci 12 06609 g002
Figure 3. Increase in world population in the period of 1900–2021. The colors depend on the population size, with the width being proportional to population size. The labels intermittently depict the year and population size, with the years shown in gray, while the population size is colored identically to the polygons. The population size is expressed in billions (e.g., 1.7 B represents 1.7 billion).
Figure 3. Increase in world population in the period of 1900–2021. The colors depend on the population size, with the width being proportional to population size. The labels intermittently depict the year and population size, with the years shown in gray, while the population size is colored identically to the polygons. The population size is expressed in billions (e.g., 1.7 B represents 1.7 billion).
Applsci 12 06609 g003
Figure 4. Seven deadliest wars in human history. The length of each spiral segment is proportional to the war’s duration, and its area size to its death toll. The death toll is expressed in millions (e.g., 9.9 M represents 9.9 million).
Figure 4. Seven deadliest wars in human history. The length of each spiral segment is proportional to the war’s duration, and its area size to its death toll. The death toll is expressed in millions (e.g., 9.9 M represents 9.9 million).
Applsci 12 06609 g004
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Skok, G. Spiral Strip. Appl. Sci. 2022, 12, 6609. https://doi.org/10.3390/app12136609

AMA Style

Skok G. Spiral Strip. Applied Sciences. 2022; 12(13):6609. https://doi.org/10.3390/app12136609

Chicago/Turabian Style

Skok, Gregor. 2022. "Spiral Strip" Applied Sciences 12, no. 13: 6609. https://doi.org/10.3390/app12136609

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop