Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Make a Saunders plot of a function
| ResourceFunction["SaundersDigitPlot"][f,b,k,{x,xmin,xmax},{y,ymin,ymax}] makes a Saunders plot of the kth base‐b digit of f as a function of x and y. | |
| ResourceFunction["SaundersDigitPlot"][f,b,k,{x,y}∈reg] takes the variables {x,y} to be in the geometric region reg. | 
A Saunders plot of a function's first base-10 digit to the right of the decimal point:
| In[1]:= | ![ResourceFunction["SaundersDigitPlot"][
 Sin[x] Sin[y], 10, 1, {x, -4, 4}, {y, -3, 3}, PlotPoints -> 55]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/7b4c904518dc62c6.png) | 
| Out[1]= |  | 
Visualize the third binary digit:
| In[2]:= | ![ResourceFunction["SaundersDigitPlot"][
 Sin[x] Sin[y], 2, 3, {x, -4, 4}, {y, -3, 3}, PlotPoints -> 55]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/416b10590e8c16a0.png) | 
| Out[2]= |  | 
Use a different color scheme and legend:
| In[3]:= | ![ResourceFunction["SaundersDigitPlot"][
 Sin[x] Sin[y], 2, 3, {x, -4, 4}, {y, -3, 3}, ColorFunction -> GrayLevel, PlotLegends -> Automatic, PlotPoints -> 55]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/731dc7ae2999fafb.png) | 
| Out[3]= |  | 
Use a non-integer base:
| In[4]:= | ![ResourceFunction["SaundersDigitPlot"][
 Sin[x + Cos[y]], \[Pi], 2, {x, -2, 2}, {y, -2, 2}, PlotPoints -> 45]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/2eca8045880d0c44.png) | 
| Out[4]= |  | 
Use PlotPoints and MaxRecursion to control adaptive sampling:
| In[5]:= | ![ResourceFunction["SaundersDigitPlot"][
 Sin[x y], 10, 2, {x, 0, 4}, {y, 0, 4}, MaxRecursion -> 5, PlotPoints -> 25]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/3bcf75a2d9cd544a.png) | 
| Out[5]= |  | 
The domain may be specified by a region:
| In[6]:= | ![ResourceFunction["SaundersDigitPlot"][
 Sin[x + Cos[y]], 10, 1, {x, y} \[Element] Disk[{0, 0}, 3], PlotPoints -> 55]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/49b1db3ff3265913.png) | 
| Out[6]= |  | 
Explicitly specify a color function:
| In[7]:= | ![ResourceFunction["SaundersDigitPlot"][
 Re[Sin[x + I y]], 2, 3, {x, -\[Pi], \[Pi]}, {y, -\[Pi], \[Pi]}, ColorFunction -> (GrayLevel[1 - #] &), PlotPoints -> 75]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/1592387b262b940b.png) | 
| Out[7]= |  | 
Use an indexed color:
| In[8]:= | ![ResourceFunction["SaundersDigitPlot"][
 Re[Sin[x + I y]], 5, 1, {x, -\[Pi], \[Pi]}, {y, -\[Pi], \[Pi]}, ColorFunction -> 61, PlotPoints -> 75]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/1d01a15cf2ae3c03.png) | 
| Out[8]= |  | 
Use a named color gradient:
| In[9]:= | ![ResourceFunction["SaundersDigitPlot"][
 Re[Sin[x + I y]], 5, 1, {x, -\[Pi], \[Pi]}, {y, -\[Pi], \[Pi]}, ColorFunction -> "BrightBands", PlotPoints -> 75]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/771691129279675e.png) | 
| Out[9]= |  | 
Show a legend for the digits:
| In[10]:= | ![ResourceFunction["SaundersDigitPlot"][
 Im[Sin[x + I y]], 5, 1, {x, -\[Pi], \[Pi]}, {y, -\[Pi], \[Pi]}, PlotLegends -> Automatic, PlotPoints -> 75]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/16da3e8fdb1c0fba.png) | 
| Out[10]= |  | 
Use Placed to change legend position:
| In[11]:= | ![ResourceFunction["SaundersDigitPlot"][
 Im[Sin[x + I y]], 5, 1, {x, -\[Pi], \[Pi]}, {y, -\[Pi], \[Pi]}, PlotLegends -> Placed[Automatic, Before], PlotPoints -> 75]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/17ee2876b81dc754.png) | 
| Out[11]= |  | 
Visualize the base-5 digits of a doubly periodic function:
| In[12]:= | ![ResourceFunction["SaundersDigitPlot"][
 Re[JacobiSN[x + I y, 1/2]], 5, 1, {x, -2 EllipticK[1/2], 2 EllipticK[1/2]}, {y, -2 EllipticK[1/2], 2 EllipticK[1/2]}, ColorFunction -> 61, PlotPoints -> 205]](https://www.wolframcloud.com/obj/resourcesystem/images/747/747a819d-19ce-4577-811f-a222927af05f/1d9a54ae7b4f6eb1.png) | 
| Out[12]= |  | 
This work is licensed under a Creative Commons Attribution 4.0 International License