Visualization Overview

Brett Champion
Visualization Manager, Wolfram Research

Topics

Highlighting

High-Dimensional Visualization

Ternary Plots

Scaling Expansions

Plot Styling

Visualization & Graphics @ WTC23

MinHsuan Peng — Interactive Highlighting @ 1pm today

Nirmal Malapaka — Tabular Data Visualization @ 1:30pm today

Alec Shedelbower — Advanced Graphics with Shader Graphs @ 2pm today

Yuzhu Lu — Customize Mathematica Graphics Rendering with GLSL @ 2:30pm today

James Lane — Graphics: New Features and Improvements @ 3pm today

Team — Office Hour: Visualization @ 9:30 tomorrow

Algorithms R&D Live @Youtube

https://www.youtube.com/@WolframRD

Highlighting

Interactive highlighting:

Mousing over the curves or points in plots highlights the mouse position and adds a label.

StackedListPlot[]

Use different highlighting effects:

You can change the highlighting effect with the PlotHighlighting option or Highlighted wrapper.

The slice highlighting effects use lines as well as points, and include multiple labels.

StackedListPlot[,PlotHighlighting->"XSlice"]

Use Placed to generate static highlights:

Placed specifies a specific location or set of locations to highlight, resulting in a permanent effect, useful for sharing or publication.

StackedListPlot[,PlotHighlighting->Placed["XSlice",7]]

High-Dimensional

New Pairwise plots for n-D data

The Fisher iris data set contains measurements for many irises.  Each row is an individual iris, and each column is an aspect that was measured.

Grid[Take[,10],]

PairwiseListPlot creates an array of scatter plots, looking at just two columns at a time. Each point corresponds to a single row.

PairwiseListPlot[,Headers->{"sepal length","sepal width","petal length","petal width"}]

PairwiseDensityPlot and PairwiseSmoothDensityPlot behave similarly.

PairwiseSmoothDensityHistogram[,Headers->{"sepal length","sepal width","petal length","petal width"}]

PairwiseQuantilePlot and PairwiseProbabilityPlot create Q-Q and P-P plots from the columns. In these cases an individual point will not reprepesent a single row in the data.

PairwiseQuantilePlot[,Headers->{"sepal length","sepal width","petal length","petal width"}]

Ternary Plots

Uses u+v+w=1 to turn {u, v, w} data into {x, y} for plotting

Ternary plots take some practice to read. The corners correspond to values that are {1,0,0}, {0,1,0}, or {0,0,1}.  In the interior, rather than reading the closest point on the axes, you have to move parallel to the axes as shown by the dotted droplines.

Geology was an early big user of ternary plots

Classifying soil by how much sand, silt and clay it contains is important for construction purposes.

TernaryListPlot[, FrameLabel->{Style["Sand",Bold,16],Style["Silt",Bold,16],Style["Clay",Bold,16]},Prolog->{{Directive[{Opacity[0.5],}],Polygon[{{0.2, 0.6, 0.2}, {0.2, 0.2, 0.6}, {0.6, 0.2, 0.2}}]},}]

Scaling Expansions

Scaling Everywhere

Currently about 70% of the visualization functions work with ScalingFunctions, with the ones that don’t being things for which it generally doesn’t make much sense, such as PieChart, GeoListPlot, MoleculePlot, etc...

StreamPlot[{-1-x^2+y,1+x-y^2},{x,0.1,10},{y,0,10}]

So now if you need to create a stream plot with a log-scaled x-axis and a reversed y-axis, it just works:

StreamPlot[{-1-x^2+y,1+x-y^2},{x,0.1,10},{y,0,10},ScalingFunctions->{"Log","Reverse"}]

Date scales

We are also extending scaling function beyond the traditional ones to make it easy to create date scales.

dateData={{"01-01",1},{"01-02",2},{"01-03",4},{"01-04",3},{"01-05",5},{"01-06",6},{"01-07",5},{"01-08",6}};

Using DateScale we can control the parsing and formatting of dates, such as enforcing MM-DD for this data.

ListLinePlot[dateData,ScalingFunctions->{DateScale[DateFunction->(DateObject[{#,{"Month","-","Day"}}]&)],None}]

Alternately we can use DD-MM:

ListLinePlot[dateData,ScalingFunctions->{DateScale[DateFunction->(DateObject[{#,{"Day","-","Month"}}]&)],None}]

Nominal scales are purely categorical

Categorical scales are also available, so I can plot the results of flipping a (virtual) coin directly.

Nominal scales are just a set of values, with no ordering or distance included.

ListPlot[RandomChoice[{"Heads","Tails"},100],ScalingFunctions->NominalScale[{"Heads","Tails"}]]

Specify how you want the categorical values to be displayed:

ListPlot[RandomChoice[{"Heads","Tails"},100],ScalingFunctions->NominalScale[\[LeftAssociation]"Heads"->"🌖","Tails"->"🌘"\[RightAssociation]]]

Ordinal scales are ordered categories

Ordinal scales are also categorical, but they are ordered, so there is a you can determine whether a<b for any two category values.

You can also assign values to them in cases where the ordering isn’t in equal steps.

ListPlot[,ScalingFunctions->OrdinalScale[{"Totally Dissatisfied","Dissatisfied","Neutral","Satisfied","Totally Satisfied"},{-1,0,1,3,6}]]

Styling

Updated default gradient

DensityPlot, ContourPlot, and related functions are now using an updated color scheme that has a wider dynamic range, and is generally just brighter to look at.

{DensityPlot[Sin[(Sqrt[x y])]Cos[(Sqrt[x])-(Sqrt[y])],{x,0,20},{y,0,20},PlotPoints->50],ContourPlot[Sin[(Sqrt[x y])]Cos[(Sqrt[x])-(Sqrt[y])],{x,0,20},{y,0,20},PlotPoints->50]}

It is also closer to what we started using for the vector visualization functions starting in V12.1.

StreamPlot[{y,-x+y},{x,-3,3},{y,-3,3}]

Shader Effects

Blurring

Blurring renders elements in a blurred style, which may be useful for de-emphasis.

Graphics[{Blurring[10],Text[Style["Wolfram",96]],AbsoluteThickness[10],Circle[{0,0},1]},ImagePadding->30]

DropShadowing

Drop-shadowing draws a second copy of the element in a shifted location behind the element, giving a light 3D effect.

Graphics[{DropShadowing[{10,-10},10,Red],Text[Style["Wolfram",96]],AbsoluteThickness[10],Circle[{0,0},1]},ImagePadding->30]

Haloing

Haloing effectively draws a border around everything.

Graphics[{Haloing[Red,5],Text[Style["Wolfram",96]],AbsoluteThickness[10],Circle[{0,0},1]},ImagePadding->30]

This is especially useful for making text show up against arbitrary backgrounds.

These effects can be used in visualization functions to style elements.

Plot[{x Sin[(x^2)],x,-x},{x,0,7},PlotStyle->{Directive[Purple,Haloing[LightPurple,2,5]],,}]

BarChart[{{3,5,4},{6,2,5}},ChartStyle->{Directive[,DropShadowing[]],Directive[,DropShadowing[]],Directive[,DropShadowing[]]}]