Skip to main content

The role of boundary length and adjacent patch contrast in guppy mate choice: Dataset, Matlab and R codes

Cite this dataset

Sibeaux, Adelaide; Camduras, Thomas; Endler, John A. (2020). The role of boundary length and adjacent patch contrast in guppy mate choice: Dataset, Matlab and R codes [Dataset]. Dryad.


The presence of various combinations of adjacent colours within polymorphic species’ colour pattern could have a major impact on mate choice. We studied the role of pattern geometry in predicting mate choice in guppies using boundary strength analysis (BSA). BSA estimates the visual contrast intensity between two adjacent colour patches (ΔS) weighted by the lengths of the boundaries between these adjacent colour patches. We measured both the chromatic (hue and saturation) and achromatic (luminance) ΔS for each pair of adjacent patches. For each male’s colour pattern, we measured BSA as both mean (mΔS) and coefficient of variation (cvΔS) of all ΔS weighted by their corresponding boundary lengths. We also determined if specific colour patch boundaries had an impact on female preferences and whether these predicted overall male contrast (mΔS). We found that males with a higher mΔS were more attractive to females and that six boundaries containing either fuzzy black or black as one of the pair colours significantly affected female preferences, indicating that (1) females favoured highly conspicuous males and (2) melanin-based patches could be used as a signal amplifier, not only for orange but for other colours.


Detailed methods describing the dataset collection and appendix methods can be found in Sibeaux, Camduras and Endler (2020), The role of boundary length and adjacent patch contrast in guppy mate choice.


Testing procedure

We tested how male patch boundaries and their visual contrast affect their attractiveness to female guppies. 60 males were chosen randomly from four different stock tanks and were allocated to one of the 20 groups of three males (“trio”, labelled A to T, Table A3). In each trio, each male displayed a different pattern according to the human eye.


Males were transferred from their stock tanks to individual 3L tanks two days before their first experimental trial for acclimation. Before each test, males were transferred from their 3L tanks to individual chambers of 8 x 8 x 12.5 cm. These chambers had 1cm of white gravel at the bottom and 8.5 cm of water. The side and back walls of these chambers were covered with back plastic sheets. In every chamber, 5ml of water coming from the male’s stock tank was added, to reduce stress and bring chemical cues mimicking the presence of other fish.  These three chambers were placed at the experimental section of the test tank opposite the sliding door (Figure 1).


We ran 160 mate choice trials. Each female saw each of the 20 trios of males in the same order (Table A3). Each female saw four groups of males per day and each male saw four females. To control for male motivation and female interest, a gap of 48 hours was allowed before a female saw another four sets of male trios. For the sake of consistency, if a set of four male groups presented at a certain time (am or pm) to the four first females then it was presented at the same time to the other four females 48 hours later. However, the order that females were used in changed for each session. This way, all females had the chance to be in the first-time position at least once (Table A3).

During this experiment, three males out of 60 had to be replaced by new ones because they showed erratic swimming or constant swimming near the water surface. This increased the number of males in the experiment to 63.

We conducted trials as follows. Males were transferred to their individual chambers, which were placed in front of the experimental areas of the females’ tanks (Figure 1) for 10 minutes of acclimatisation. Males were assigned randomly to the right, middle or left chamber. Next, the sliding door was opened, allowing the female to enter the experimental area where she could see the males; the door was closed after the female entered this compartment. Females were allowed to swim freely in the experimental area whilst viewing the males. After 20 minutes the trial stopped, the door was opened and the female was gently ushered back to her home compartment. The trials were recorded from above, using Panasonic HC-V100 and JVC HD Everio video cameras. Prior to all sessions, males and females were fed ad libitum. The morning sessions lasted from 8:30 am until 12:30 pm whereas the afternoon sessions were between 1 pm and 5 pm.


Male photography and pattern assessment

Once males finished all behavioural trials, they were photographed following the methods in Cole & Endler (2015), see Appendix A1 for details. The photographs were then analysed with Adobe Photoshop CS5.1 and MATLAB (as in Cole & Endler, 2015). Within Photoshop we manually outlined the total fish area (i.e., from the head to the end of the caudal peduncle), the tail fin area (i.e., starting at the caudal peduncle) and the area of eleven distinct colour classes: black and yellow reticulation (present on the tail of the fish), black, fuzzy black, yellow, orange, gold, silver, green, blue and violet, and saved the outlines in a multilayer PSD file. The colour classes were based upon reflectance spectra (Figure A2). In this population we have found no colours which reflect in the UV but do not reflect in the visible, making human-visual assignment to classes and patch outlining feasible. Some structural colours can change in terms of reflectance spectra according to individual movement and hence viewing angle, whilst others do not. It depends upon whether the structural colour is based upon interference or scattering. Only interference colours change in reflectance spectral shape (hue and chroma) with angle, and only some guppy structural colours change significantly with viewing angle. The photographic setup was designed so that the camera to male angle was approximately the same as the average female to male angle during courtship. We adjusted the lighting to maximise the contrast of the structural colours. We took multiple reflectance measurements of each male for each colour classes in order to control as much as possible for reflectance variation in structural colour patches. We used MATLAB to read the PSD file layers, calculate the transition Matrix and used the transition Matrix to extract the relative colour area measurements, the numbers of each transition between colours, and lengths of each transition in the pattern (2 pixels sampling grid, Endler, 2012; Endler et al., 2018). Because of the high degree of symmetry between the left and right sides in our population (93% of males, Cole & Endler 2015, 2016), only the right-side colour pattern was analysed.

Male BSA pattern contrast measurement

We determined males’ colour pattern contrast using the Boundary Strength Analysis method (BSA), which gives an estimate of the local contrast in the male colour pattern (Endler et al., 2018). The strength (intensity of visual contrast) of a boundary is estimated by ΔS (distance in receptor space) between adjacent colour patches using the receptor noise model (Vorobyev & Osorio, 1998, see Siddiqi et al., 2004 for the model utilised for achromatic contrast). ∆S is an estimate of the likelihood of colour discrimination between two stimuli; when ΔS=1, two visual stimuli are just noticeably different (JND, Vorobyev & Osorio, 1998; Endler & Mielke, 2005; Kemp et al., 2015). An individual can potentially discriminate one stimulus from the other if ΔS≥1. Under this threshold (ΔS<1) the viewer is unlikely to discriminate between two stimuli. In guppies, the behavioural discrimination threshold is close to the RNL model prediction when 0.2 is used as the standard deviation of the noise in photoreceptor (Sibeaux et al., 2019b). We used the formulae in Vorobyev & Osorio (1998) and Kelber et al. (2003) to calculate chromatic ∆S (equation 5 and B4 respectively, see appendix A2 for formulae); we used the adaptation of the formula in Siddiqi et al. (2004) to calculate achromatic ∆S. To calculate ∆S we used 0.2 as the numerator of the Weber fraction (Sibeaux et al. 2019b). In guppies, the photoreceptor relative abundance and their spectral sensitivity are 1;1;2;2 and λmax= 359 nm; 408 nm; 465 nm; 560 nm for UVS; SWS; MWS and LWS cones respectively (Long, 1993; Kawamura et al., 2016; see Appendix A2 for the details of the calculation). BSA takes into account the light environment irradiance spectra, the reflectance spectra and relative area of each colour pattern component, the spectral sensitivity functions of the guppy photoreceptors and the geometry of the colour pattern by considering which colours are adjacent (i.e. having a common boundary).  It uses the intensity (i.e., magnitude of ΔS for a given patch contact zone) as well as the length of the boundary between the patches and ignores non-adjacent colour pairs (see Appendix A2 for all formulae).

For a given colour pattern, we calculated ∆S for each pair of colour classes which shared a common boundary (e.g., orange-black, blue-green). We also calculated their common boundary lengths. For each male colour pattern, we calculated the mean ∆S of all kinds of adjacent pairs weighted by their total boundary length and will refer to this as m∆S.  We also calculated the weighted coefficient of variation of ∆S (cv∆S) across the male pattern (Appendix A2, Endler et al., 2018).

Chromatic and achromatic ∆S values were calculated separately (Appendix A2, Figure A6, Table A4), to be able to measure chromatic and achromatic m∆S and cv∆S for each male. Chromatic cues are detected by all four visual cone classes while achromatic cues are detected only by the double cones. We calculated ∆S for chromatic visual channels, using all 4 guppy cone classes, and achromatic ∆S using the guppy double cones (see appendix A2 for cone and eye details).

Video analysis

To be blind to male colour patterns with respect to behaviour, male BSA contrast and videos were analysed independently by different co-authors (AS and TC respectively).

Video recordings of the tests were analysed using JWatcherTM 0.9 software (Blumstein et al., 2006). Assuming that a female was attracted by a male if she chose to be near him (Baerends et al., 1955), rather than swimming elsewhere, we set up an "area of interest".  An area of female interest was defined using a black nylon thread clipped at the top of the tank 3 cm away from the front wall of the male chambers. Because the cameras filmed from above, this thread delimitated a 3 cm wide and 23cm long zone in the experimental chamber in front of the male chambers. Females were recorded as being interested in a male when they were in the area of interest, in front of the male, directly facing his chamber. If a female was swimming in the area of interest but was facing away from the male, or if she was foraging on gravel in this area, she was not considered to be interested. Males were said to be interested in a female when they swam towards her and when they kept swimming at or very close to the wall facing her aquarium (Baerends et al., 1955), but only if the female showed interest first.

We measured a male's attractiveness as the time that a female spent with him (during the 20 minutes of trial). Because males and females were not able to contact each other in the experiment, the male’s visual attractiveness measured here is used as a proxy of male overall sexual attractiveness, and non-visual cues are excluded by the clear partitions. There is a possible confusion with social attractiveness, although the mirror image of the female in her home compartment of the tank mitigates this. We are examining relative attractiveness here, where, if a female spends most time with a particular male, he is the relatively most attractive either sexually, socially or both. Male responsiveness was measured as the time that this particular male was responsive to a given female divided by the time that the female spent interested in him.


ARC DP1510102817 and DP150102710

ARC DP1510102817 and DP150102710