Multipanel Visualization

Brett Champion

Wolfram Research

Topics

Graphics Grid

PlotLayout & ChartLayout

Single Panel

GraphicsGrid

GraphicsGrid is the most general way of combining multiple plots into a gridded layout.

GraphicsGrid[Table[Plot[x^i Sin[j x],{x,0,2Pi},Frame->True],{i,0,2},{j,3}]]

GraphicsGrid takes some effort to line up plot range boundaries, but that’s about it.

PlotLayout and ChartLayout

Over the past few versions we’ve been rolling out multipanel support for individual plotting and charting functions through their PlotLayout and ChartLayout options.

Generally plots of multiple functions or datasets put all the plots in the same scene:

Plot[Evaluate[Table[j Sin[j x],{j,6}]],{x,0,2Pi},Frame->True]

By setting PlotLayout (or ChartLayout), each plot gets its own scene:

Plot[Evaluate[Table[j Sin[j x],{j,6}]],{x,0,2Pi},Frame->True,PlotLayout->{"Row", 2}]

Because the individual scenes are coming from the same overall evaluation, we’re able to link aspects of them together.  In the example above, they all have the same plot range, so we don’t have to duplicate the axes.

Scene Synchronization

Besides plot ranges, there are many things that are synchronized, that might not be easily possible when using multiple, individual calls to a visualization function.

DensityPlot

Row[{DensityPlot[Sin[x]+Cos[y],{x,-2,2},{y,-2,2},PlotLegends->Automatic],DensityPlot[x^2-y^2,{x,-2,2},{y,-2,2},PlotLegends->Automatic]}]

DensityPlot[{Sin[x]+Cos[y],x^2-y^2},{x,-2,2},{y,-2,2},PlotLegends->Automatic,PlotLayout->"Row"]

ContourPlot

Row[{ContourPlot[Sin[x]+Cos[y],{x,-2,2},{y,-2,2},PlotLegends->Automatic],ContourPlot[x^2-y^2,{x,-2,2},{y,-2,2},PlotLegends->Automatic]}]

ContourPlot[{Sin[x]+Cos[y],x^2-y^2},{x,-2,2},{y,-2,2},PlotLegends->Automatic,PlotLayout->"Row"]

VectorPlot

Row[{VectorPlot[{y,y-x},{x,-3,3},{y,-3,3},PlotLegends->Automatic],VectorPlot[{y^2-x,x^2+y},{x,-3,3},{y,-3,3},PlotLegends->Automatic]}]

VectorPlot[{{y,y-x},{y^2-x,x^2+y}},{x,-3,3},{y,-3,3},PlotLegends->Automatic,PlotLayout->"Row"]

StreamPlot

Row[{StreamPlot[{y,y-x},{x,-3,3},{y,-3,3},PlotLegends->Automatic],StreamPlot[{y^2-x,x^2+y},{x,-3,3},{y,-3,3},PlotLegends->Automatic]}]

StreamPlot[{{y,y-x},{y^2-x,x^2+y}},{x,-3,3},{y,-3,3},PlotLegends->Automatic,PlotLayout->"Row"]

Histogram

Row[{Histogram[],Histogram[]}]

Histogram[{,},ChartLayout->"Row"]

SmoothHistogram

Row[{SmoothHistogram[],SmoothHistogram[]}]

SmoothHistogram[{,},PlotLayout->"Row"]

Multiaxis Presentations

MultiaxisArrangement introduces the ability for ListPlot and ListLinePlot to use different scales and axes for different datasets in a single plot.

The first dataset uses the scale on the left edge of the frame, and the second dataset uses the scale on the right edge of the frame.

ListLinePlot[{PrimePi[Range[100]], EulerPhi[Range[100]]},MultiaxisArrangement->All]

This is useful comparing the trends between datasets with different scales of magnitude, such as stock prices.

companies={LinguisticAssistant,,LinguisticAssistant};

price=EntityValue[companies,EntityProperty["Financial","Close",{"Date"->Interval[{(DateObject["Fri 1 Oct 2021", DateObject[{2021,10,1},"Day"]]),(DateObject["Fri 30 Sep 2022", DateObject[{2022,9,30},"Day"]])}]}]];

ListLinePlot[price,PlotLabels->companies]

By default the new MultiaxisArrangement option uses separate scales for each dataset, matched up by color.

ListLinePlot[price,MultiaxisArrangement->All,ScalingFunctions->{"Date",None}]

Specify the placement of the axes for each curve, grouping the second and third sets on the right.

ListLinePlot[price,MultiaxisArrangement->{Left->{1},Right->{2,3}},ScalingFunctions->{"Date",None}]

Conserve space by having two of the datasets share an axis when they have similar ranges.

ListLinePlot[price,MultiaxisArrangement->{Left->{1},Right->{{2,3}}},ScalingFunctions->{"Date",None}]