SIParCS 2021 - Erin Lincoln

Erin Lincoln

Erin Lincoln (she/her), Brown University

Expanding and strengthening the transition from NCL to Python visualizations

Recorded Talk

As NCL is put into maintenance mode, Matplotlib, a plotting library in the Python ecosystem, is the main source for creating plots in the NCL style. However, basic Matplotlib plots and NCL plots have key differences. The goal of this project was to be able to make NCL-style plots in Python with the same ease as in NCL. With the unique style of NCL, there are often repeated code segments between recreated NCL plots. Therefore, utility functions within GeoCAT-Viz were created to reduce the amount of code needed for the recreations. However, multiple utility functions and other common code segments were needed to recreate a plot, which causes the resulting script to be around 400% longer than the original NCL code. To solve this problem, a series of wrapper classes were created to achieve similar effects as one-line functions in NCL. The parent class for the set of classes is NCL Plot, which contains the common functionalities that exist in most plots, such as certain stylistic choices from NCL and basic functions of Matplotlib. The first of many future child classes is Contour, which specifically creates contour figures and adds other related functionalities, such as contour labels. The creation of these classes led to an overall improvement in code length, with the resulting script being about ten lines longer than the NCL script. This made the transition to visualizations in Python more realistic as it was as convenient to create an NCL-style plot in Python as it was in NCL.

Mentors: Julia Kent, Orhan Eroglu, Michaela Sizemore, & Anissa Zacharias

Slides and poster