Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Make a random scribble graphic
ResourceFunction["RandomScribble"][] generates a scribble graphic. |
"ColorFunction" | Automatic | how to colorize the scribble |
"ConnectingFunction" | BezierCurve | how to make the scribble strokes |
"EnvelopeFunctions" | None | functions for the bottom and top envelopes of the scribble |
"NumberOfStrokes" | 120 | number of scribble strokes |
"OrderedStrokePoints" | True | whether to order the stroke end points |
"RotationAngle" | Automatic | angle used to rotate the scribble |
PlotStyle | {} | plot styles used to draw the scribble |
Generate a random scribble:
In[1]:= |
|
Out[2]= |
|
Generate a scribble with different option settings:
In[3]:= |
|
Out[4]= |
|
Generate a "cross" scribble:
In[5]:= |
|
Out[6]= |
|
Here are gray-level and colorized scribbles generated with single-scribble mode:
In[7]:= |
|
Out[8]= |
|
In[9]:= |
|
Out[10]= |
|
Here are gray-level and colorized scribbles generated using multi-scribble mode:
In[11]:= |
|
Out[12]= |
|
In[13]:= |
|
Out[14]= |
|
Make "orderless" scribbles with fill-ins:
In[15]:= |
|
Out[16]= |
|
ColorFunction can also take strings that are color schemes known by ColorData.
Here are colorized scribbles generated using single-scribble mode:
In[17]:= |
|
Out[17]= |
|
Here are scribbles generated using multi-scribble mode:
In[18]:= |
|
Out[18]= |
|
The option "ConnectingFunction" specifies which graphics primitive to be used between the scribble points:
In[19]:= |
|
Out[18]= |
|
The option "EnvelopeFunctions" specifies functions for the bottom and top envelope curves within which the scribble is drawn. If only one function is given, say F, then that function is considered to be for the top curve and bottom curve function is derived as (-F[#]&):
In[20]:= |
|
Out[18]= |
|
If the envelope functions produce complex numbers, the real parts are taken:
In[21]:= |
|
Out[22]= |
|
The option "NumberOfStrokes" controls how many segments the scribble has:
In[23]:= |
|
Out[18]= |
|
If the option "NumberOfStrokes" is given a list of positive integers, then multi-scribble graphics are generated:
In[24]:= |
|
Out[25]= |
|
The option "OrderedStrokePoints" controls whether the scribble should be more uniform or completely random:
In[26]:= |
|
Out[26]= |
|
The option "RotationAngle" specifies the angle by which the scribble is rotated:
In[27]:= |
|
Out[18]= |
|
If the option "RotationAngle" is given a list of reals, then multi-scribble graphics are generated:
In[28]:= |
|
Out[29]= |
|
In multi-scribble mode, if the value of "RotationAngle" is Automatic, then the generated scribbles are placed over a regular set of rotation angles. If the option value Random is given, then the rotation angles are random:
In[30]:= |
|
Out[31]= |
|
With the option PlotStyle, different stylings of the scribble drawing can be specified:
In[32]:= |
|
Out[18]= |
|
In multi-scribble mode, colors specified in PlotStyle are replaced by the colors generated with the option ColorFunction:
In[33]:= |
|
Out[34]= |
|
Combine two colorized single-mode scribbles into a "cross" scribble:
In[35]:= |
|
Out[18]= |
|
Generate a colorized single-mode scribble with a restricted range of a given color scheme and compare it with a scribble that uses the full color scheme range:
In[36]:= |
|
Out[33]= |
|
Add scribbles to an image:
In[37]:= |
|
Out[38]= |
|
Display the elements of a matrix using scribbles:
In[39]:= |
|
Out[18]= |
|
Here is the "scribble representation" of the matrix:
In[40]:= |
|
Out[41]= |
|
Some of the implementation details can be illustrated with appropriate comparison tables. This coloring-versus-connecting table illustrates how the coloring of singe-mode scribbles is implemented:
In[42]:= |
|
Out[43]= |
|
RandomScribble can be used in more or less the same way as the resource function RandomMandala. Here, RandomScribble is used with the resource function TexturizePolygons:
In[44]:= |
|
Out[18]= |
|
Here, the resource function RandomMandala is used with the resource function TexturizePolygons:
In[45]:= |
|
Out[46]= |
|
Specify a constant color function to use the same color for all scribbles in multi-scribble mode:
In[47]:= |
|
Out[18]= |
|
Alternatively, specify ColorFunction to be None and PlotStyle to have the desired color:
In[48]:= |
|
Out[49]= |
|
A table of random scribbles using the "RedBlueTones" color scheme and a regular set of rotation angles:
In[50]:= |
|
Out[50]= |
|
A table of random multi-scribble graphics:
In[51]:= |
|
Out[51]= |
|
A table of random scribbles with unordered stroke points and fill-ins:
In[52]:= |
|
Out[52]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License