As mentioned in the last post there were a few more ideas I wished to pursue. For better or worse. For instance, differing marker shapes. What happens when starting the plots at different points in the line width cycle. So, let’s get at it.
Differing Marker Shapes
I have been using a circular marker shape. Seemed to me that if I wanted a smoothly cycling line width a circle was a good choice. But there are on the order of 3 dozen marker shapes. And by the use of special font types considerably more.
So, I thought I’d try selecting a marker at random for each half of the plot. In order to have a look at the effect of marker shape, I decided to add new plot types. But, I will likely eventually add the use of random marker shapes to the current plots on some frequency. Probably about 1/3 of the time. I also did not select from all the possible shapes.
# possible markers for plots 15/16
poss_mrkrs = ['o', '8', 'p', '*', 'h', 'H', 'D', 'd', '1', '2', '3', '4']
...
if not t_sv:
# mx_sz = np.random.choice(list(range(1500, 5001, 500)))
mx_sz = np.random.choice(list(range(1500, 10501, 1000)))
sz_mult = mx_sz // hf_frq
m1 = np.random.choice(poss_mrkrs)
m2 = np.random.choice(poss_mrkrs)
...
ax.scatter(t_xs[-1][i::lc_frq], t_ys[-1][i::lc_frq], s=m_sz, alpha=alph, marker=m1)
...
ax.scatter(t_xs[-1][i::lc_frq], t_ys[-1][i::lc_frq], s=m_sz, alpha=alph, marker=m2)
I managed to get an example of the same plot (10 ellipses) with only circle markers and with random marker shapes. A bit of fooling about as my code not really geared for easily doing that kind of thing.
Cycle size: 142
, max marker size: 5500
.
Cycle size: 142
, smax marker size: 9500
, m1: D (diamond), m2: H (hexagon2).
Cycle size: 200
, max marker size: 8500
, m1: p (pentagon), m2: H.
The marker shape definitely makes itself known.
Here’s one with completely different marker shapes highlighting the possibilities. Or perhaps the dangers? 7 ellipses. Cycle size: 50, max marker size: 10500, m1: * (star), m2: 4 (unfilled tri_right).
Random Cycle Starting Point
One last thing I’d like to look at in this post. I expect that where I start plotting the cycle will likely affect the image as parts of the plot overwrite other parts. The result is also affected by the opacity used to plot the markers. So, I am going to randomly select from a small number of possible starting points and see what happens.
Rather than allow for any starting point I am just going to use a few potential values (percentages as cycle sizes vary). Then calculate the start and end points for each plotting loop. As well as the initial marker size for both plotting loops.
c_start = [0, 25, 33, 50, 66, 75]
...
if t_lfr and (not t_sv):
t_fst = np.random.choice(c_strt)
if t_fst == 0:
s1 = 0
e1 = hf_frq
s2 = hf_frq
e2 = lc_frq
m_sz1 = sz_mult
m_sz2 = hf_frq * sz_mult
elif t_fst == 50:
s1 = hf_frq
e1 = lc_frq
s2 = 0
e2 = hf_frq
m_sz1 = hf_frq * sz_mult
m_sz2 = sz_mult
else:
s1 = int(lc_frq * t_fst / 100)
e1 = lc_frq
s2 = 0
e2 = s1
m_sz1 = s1 * sz_mult
m_sz2 = sz_mult
A bit of refactoring required for the plotting code. Still keeping track of whether or not the marker size is increasing or decreasing.
for i in range (s1, e1):
ax.scatter(t_xs[-1][i::lc_frq], t_ys[-1][i::lc_frq], s=m_sz1, alpha=alph, marker=m1)
if i < hf_frq:
m_sz1 += sz_mult
else:
m_sz1 -= sz_mult
for i in range(s2, e2):
ax.scatter(t_xs[-1][i::lc_frq], t_ys[-1][i::lc_frq], s=m_sz2, alpha=alph, marker=m2)
if i < hf_frq:
m_sz2 += sz_mult
else:
m_sz2 -= sz_mult
First Start Point Near Larger Marker Sizes
When the plotting starts later in the cycle things do not go “smoothly”. In the image below you will see a thin marker cycle crashing into a thick one. This was fairly consistent for (circular marker shape) for any start point 50% or higher. And, as I wasn’t particularly fond of the look, I removed those values from the available start percentages.
The list of cycle start percentages is now c_strt = [0, 12, 25, 33]
Examples
Okay, time for some examples.
The first one is 6 ellipses, cycle size of 166, maximum marker size of 2490, starting at 12%, first loop runs (19, 166), markers are circles.
The next one is 6 wheels of shape: [’s’, ’s’, ’t’, ’s’, ‘q’, ‘c’], cycle: 142, max marker size: 9443, starting at 33% with the first loop running (46, 142), markers are circles for both plotting loops.
The more images I generated, the more I realized I really didn’t much like the ones that started part way into the cycle. So, I am now going to drop that bit from my code. Personal taste of course, but also my code.
A Few More Examples
Well may be several more examples.
Done
A bit of code, a goodly number of images. Seems like a reasonable time to call it a day.
Until next time, be happy working on your code.