Wolfram Research

Function Repository Resource:

HofstadterButterfly

Source Notebook

Plot successive steps of Hofstadter’s butterfly

Contributed by: Enrique Zeleny

ResourceFunction["HofstadterButterfly"][n]

show the plot for n steps of Hofstadter’s butterfly.

Details and Options

ResourceFunction["HofstadterButterfly"] has the same options as Graphics, as well as ColorFunction and PlotStyle.

Examples

Basic Examples

Show 15 steps for Hofstadter’s butterfly:

In[1]:=
ResourceFunction["HofstadterButterfly"][15]
Out[1]=

Options

PlotStyle

In[2]:=
ResourceFunction["HofstadterButterfly"][10, PlotStyle -> {Thickness[.01]}]
Out[2]=

ColorFunction

In[3]:=
ResourceFunction["HofstadterButterfly"][20, ColorFunction -> ColorData["BrightBands"]]
Out[3]=
In[4]:=
ResourceFunction["HofstadterButterfly"][20, ColorFunction -> (ColorData[{"TemperatureMap", "Reverse"}][#2] &)]
Out[4]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information