Weather visualizations are very interesting—there are television channels that thrive by showing nothing else. Online, there are several sources for specific maps of current weather conditions. Generally these are produced and maintained by government agencies or other large organizations. But with Mathematica 7, you can easily produce completely customizable weather visualizations on your own computer.

As usual, this is made possible by Mathematica’s tight integration of several areas of functionality. Two new features that enable this particular application are powerful new vector visualization functions and built-in weather data.

Vector visualization has been present in Mathematica since Version 2. In Mathematica 7 it has been dramatically improved, adding modern techniques in vector data visualization and new algorithms developed at Wolfram Research. Traditional arrow-based vector plots, new methods based on automatic streamline placement, support for vector glyphs and high-resolution images produced using line integral convolutions are all now supported.

Meanwhile, the new WeatherData function provides access to data from all public weather stations worldwide. Real-time and historical data on temperature, pressure, wind speed and many other variables is immediately available for mathematical analysis and visualization.

Here is the position of every station, marked with its most recently reported wind velocity:

Comparing the daily mean temperatures in Cairo, Egypt, and Sydney, Australia, for the last three years is this easy:

Let’s see how to combine these features to produce our own weather maps. Here’s how to make a ListStreamPlot of the current wind direction across Italy:

Not bad for a single input! We used the CountryData function, which was introduced in Mathematica 6, to obtain a polygonal representation of Italy.

Now let’s build up some more detailed visualizations, step by step. Here’s a function that gives a polygonal outline of a country or region:

Stream plots of wind direction like the one we produced above can be a little deceptive, because they don’t convey any information about wind speed. We can use WeatherData to include wind speed information:

Here’s a tabulation of wind velocity vectors as a function of latitude and longitude:

These are all the ingredients we need to produce a customized ListVectorPlot :

Using our wind speed data we can revisit ListStreamPlot . A stream plot is a good option when the positioning of the underlying data points on a rectangular grid might be distracting in a ListVectorPlot . In the following stream plot, we color stream lines according to the local wind speed (brighter colors indicate higher speeds):

A lot is going on behind the scenes in ListStreamPlot . Note the way stream lines are automatically positioned to have uniform density across the plot.

Let’s further customize our weather visualization. Here’s a tabulation of wind velocity and temperature over Africa:

(The last line filters out weather stations that are currently offline.)

The new function ListVectorDensityPlot visualizes vector data together with an accompanying scalar field:

A slight variation on the above code (download the source notebook) produces this pressure/wind map of the United States: