A Crash Course in Data Visualization
with Wolfram Language

Phileas Dazeley-Gaist - Wolfram Research
(Cornell: College of Human Ecology, 2025)

Getting set up: Installing Wolfram at Cornell

1
.
Head to www.wolfram.com/siteinfo
2
.
Enter your Cornell email address in the input field
3
.
Download and install the Wolfram App
4
.
Create a Wolfram account with your institutional email address, and log into the Wolfram app using your account

Teasers

Here are a few example WL programs that with visual outputs.
By the end of this presentation you’ll have new intuitions about how these programs achieve what they do, even if you won’t necessarily know how to reproduce everything you’ll have seen.
​
Make a word from words in Alice in Wonderland:
WordCloud[ExampleData[{"Text","AliceInWonderland"}],​​ColorFunction->"IslandColors"]
Out[]=
Plot 3 random walks:
ListLinePlotTable[Accumulate[RandomReal[{-1,1},50]],3],

Out[]=
Trial 1
Trial 2
Trial 3
Color every cell in a matrix differently according to its position:
In[]:=
MapIndexed[Highlighted[#1,Background->Blend[(ColorData[10]/@#2)]]&,ConstantArray[" ",{10,10}],{2}]//MatrixForm
Out[]//MatrixForm=
Produce a Sierpiński gasket using text:
In[]:=
NestList[Subsuperscript[#,#,#]&,o,6]
Out[]=
o,
o
o
o
,
o
o
o
o
o
o
o
o
o
,
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
,
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
,
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o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
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o
o

Make a list of connections between a selection of European capital cities and Rome:
In[]:=
romeCityConnections=ThreadDeleteCasesEntityValueVertexListNestGraph#1
bordering countries/regions
&,
Italy
COUNTRY
,2,"CapitalCity",
Rome
CITY

Rome
CITY

Out[]=

Vienna

Rome
,
Paris

Rome
,
San Marino

Rome
,
Ljubljana

Rome
,
Bern

Rome
,
Vatican City

Rome
,
Prague

Rome
,
Berlin

Rome
,
Budapest

Rome
,
Vaduz

Rome
,
Bratislava

Rome
,
Andorra la Vella

Rome
,
Brussels

Rome
,
Luxemburg

Rome
,
Monaco

Rome
,
Madrid

Rome
,
Zagreb

Rome

Illustrate the saying: “All roads lead to Rome” with a map of driving directions from a selection of European Capitals to Rome:
Construct a 4-hop graph of word synonyms starting from the root node “bug”:

Wolfram Language ABCs

Before we get into data visualisation techniques with Wolfram Language, here are a few keys you’ll need to understand how to read Wolfram Language code.
A few warnings before we jump in:

  • Wolfram Language is not a programming language you ever fully learn. It’s just too big.
  • 
  • Don’t panic if you don’t immediately understand something. Programming always looks a little mysterious until you try it out, but it’s really not too bad.
  • 
  • I’ll send you this notebook later, so you’ll be able to review all the code, copy and paste examples, and mess about with it on your own time.
  • 
  • Please feel free to jump in to ask me questions. I’ll also take questions at the end of the talk.
  • Variable Assignment and Function Definitions

    Variable assignments allow you to define things by name and refer to them later.

    Storing data (List, Association, Dataset, and Tabular)

    Let’s walk through a few of the most common ways of storing data in Wolfram Language: lists, associations, datasets, and tabular objects:

    *Plot* and *Chart* functions, and Graphics

    Wolfram Language has a rich set of plotting functions that can handle everything from simple 2D plots to complex 3D graphics.

    The Plot function

    You can plot multiple functions at once by putting them in a list:

    ListPlot and ListLinePlot

    When you want to see relationships between variables, ListPlot can also be used to create scatter plots. Use Thread to pair up your lists of x and y values:
    You can compare multiple datasets by giving ListPlot or ListLinePlot a list of lists:

    BarChart and PieChart

    Histograms and Box-and-whisker plots

    BoxWhiskerChart is great for comparing distributions across categories:
    You can also use DistributionChart for a smoother representation:

    Plotting in 3D

    You can make 3D point clouds using ListPointPlot3D:
    There are also functions for more complex visualisation techniques such as FeatureSpacePlot3D.
    Define a list of images:
    Make a feature space plot of the images, where similar images will be closer together, and more distinct images will be further apart:

    Heat maps and matrix plots

    You can visualize grids of numbers using ArrayPlot or MatrixPlot (the syntax is the same for both).

    Network plots

    You can represent and visualize relationships between entities using Graph:
    Represent a fictional network of friends:

    Word clouds

    It’s really easy to make word clouds too using WordCloud:

    Geographic plots

    Produce a list of the 50 largest US cities by population:
    Plot the locations of these cities:
    There are many other plotting functions for geographic data, including GeoGraphics, GeoRegionValuePlot, GeoGraphPlot, and more.
    You can read up about them in the Geographic Visualization guide page.

    Graphics

    Graphics creates graphics from primitives like points, lines, circles, and polygons. It’s the most general graphical visualization function in the language.
    Example Graphics showing concentric circles:
    Example Graphics showing off the main types of graphics primitives:
    By combining different functions as building blocks, you can construct complex visualizations:

    More involved examples

    Other Plotting and Charting Functions

    There are too many built in functions for data viz for me to cover in this short session. Just to give you an idea:

    Giving big picture instructions (Bonus)

    There are many built-in Wolfram Language functions that make the process of shaping and wrangling data, or performing sequences of actions.
    These functions are often really useful when making data visualizations. We’ve come across a couple of them already in this presentation. Let’s see a few really common ones:

    Maps (Map, MapApply, MapThread)

    Nests (Nest, NestList, NestTree, NestGraph)

    Further reading and learning resources

    General Wolfram Language learning

    
  • An Elementary Introduction to the Wolfram Language (book you can read online)
  • 
  • The Wolfram Language: Fast Introduction for Programmers (really neat tutorial if you’ve programmed before)
  • 
  • Mathematica & Wolfram Language: Fast Introduction for Math Students
  • 
  • Wolfram U: Exploring and Getting Started with Wolfram Language
  • Data science and data processing

    
  • Wolfram U MOOC: Multiparadigm Data Science
  • 
  • Wolfram U: Using Tabular for Efficient Data Processing
  • 
  • Wolfram U: Handling Geographic Data and GIS Functionality in Wolfram Language (this one is by me)
  • 
  • Wolfram U: Creating Compelling Reports
  • 
  • Wolfram U: Computation for Social Sciences
  • 
  • Wolfram U: Breaking the Boundaries of Data Science
  • Data visualisation

    
  • Data visualisation core areas page
  • 
  • Data visualization guide page
  • 
  • Video tutorial: Data visualisation quick start
  • 
  • Wolfram U MOOC: Visual Explorations in Data Science
  • 
  • Wolfram Example Repository
  • 
  • Video series: Mathematica Essentials