Skip to main content

Visualizing Modular Forms

  • 337 Accesses

Part of the Simons Symposia book series (SISY)


We examine several currently used techniques for visualizing complex-valued functions applied to modular forms. We plot several examples and study the benefits and limitations of each technique. We then introduce a method of visualization that can take advantage of colormaps in Python’s matplotlib library, describe an implementation, and give more examples. Much of this discussion applies to general visualizations of complex-valued functions in the plane.

This work was supported by the Simons Collaboration in Arithmetic Geometry, Number Theory, and Computation via the Simons Foundation grant 546235.

The author benefitted from many conversations at the fall 2019 ICERM program on Illustrating Mathematics (where this project was born) and at the special number theory day organized at Bowdoin College by Naomi Tanabe.

This is a preview of subscription content, access via your institution.

Buying options

USD   29.95
Price excludes VAT (USA)
  • DOI: 10.1007/978-3-030-80914-0_19
  • Chapter length: 21 pages
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
USD   189.00
Price excludes VAT (USA)
  • ISBN: 978-3-030-80914-0
  • Instant PDF download
  • Readable on all devices
  • Own it forever
  • Exclusive offer for individuals only
  • Tax calculation will be finalised during checkout
Hardcover Book
USD   249.99
Price excludes VAT (USA)
Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10


  1. 1.

    Adjusting the map from magnitude to brightness for SageMath’s complex_plot is possible, but nontrivial; the map is defined internally and the current plotting interface doesn’t give any option to choose or alter this map. In order to adjust this map, it is necessary to modify the source for SageMath’s plotting routines directly.

  2. 2.

    In the period between writing and publishing this paper, the LMFDB changed its method for plotting modular forms to incorporate methods described in this paper. Thus in the rest of this paper, LMFDB-style plots refer to the style of plots in the LMFDB on October 1, 2020.

  3. 3.

    The behavior in Matlab and Maple appears similar, though it is possible to define a color scheme. On the other hand Mathematica has an extensive library of complex plotting color schemes.


  1. Fred Diamond and Jerry Shurman. A first course in modular forms, volume 228. Springer Verlag, 2005.

    MATH  Google Scholar 

  2. Frank A Farris. Visual complex analysis by Tristan Needham. The American Mathematical Monthly, 105(6):570–576, 1998.

    Google Scholar 

  3. Frank A Farris. Creating Symmetry: The artful mathematics of wallpaper patterns. Princeton University Press, 2015.

    Google Scholar 

  4. J. D. Hunter. Matplotlib: A 2d graphics environment. Computing in Science & Engineering, 9(3):90–95, 2007.

    CrossRef  Google Scholar 

  5. Peter Kovesi. Good colour maps: How to design them. arXiv preprint arXiv:1509.03700, 2015.

    Google Scholar 

  6. David Lowry-Duda. phase_mag_plot., September 2020. [Online; Reference version at].

  7. The LMFDB Collaboration. The L-functions and modular forms database., 2019. [Online; accessed 30 October 2019].

  8. Jamie R Nuñez, Christopher R Anderton, and Ryan S Renslow. Optimizing colormaps with consideration for color vision deficiency to enable accurate interpretation of scientific data. PloS one, 13(7):e0199239, 2018.

    Google Scholar 

  9. Travis E Oliphant. A guide to NumPy, volume 1. Trelgol Publishing USA, 2006.

    Google Scholar 

  10. Sage Developers. SageMath, the Sage Mathematics Software System (Version 8.8), 2020.

  11. Elias Wegert and Gunter Semmler. Phase plots of complex functions: a journey in illustration. Notices AMS, 58:768–780, 2010.

    MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations


Corresponding author

Correspondence to David Lowry-Duda .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and Permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Verify currency and authenticity via CrossMark

Cite this paper

Lowry-Duda, D. (2021). Visualizing Modular Forms. In: Balakrishnan, J.S., Elkies, N., Hassett, B., Poonen, B., Sutherland, A.V., Voight, J. (eds) Arithmetic Geometry, Number Theory, and Computation. Simons Symposia. Springer, Cham.

Download citation