Introduction

The worldwide urban cover is expected to increase two-to-six-fold in area (Seto et al. 2012; Gao and O’Neill 2020) up to at least 2050 (Chen et al. 2020). As cities continue to expand, they need to play a key role in biodiversity conservation by becoming suitable for a larger number of species of flora and fauna (Desrochers et al. 2011; Convention on Biological Diversity 2012). Consequently, several studies have investigated the relationship between landscape urbanisation and species richness and abundances, showing negative relationships for the majority of taxa (e.g. invertebrates including arthropods, as well as birds and mammals; Biard et al. 2017; Lagucki et al. 2017; Piano et al. 2017; Ramírez-Restrepo and MacGregor-Fors 2017; Merckx et al. 2018a, b; Fenoglio et al. 2020), with a few exceptions of positive (e.g. in aquatic invertebrates; Hill et al. 2017) or a lack of relationship (e.g. in arthropods; Christie and Hochuli 2009).

Urbanisation implies that during their evolutionary histories many species will increasingly encounter conditions they have not previously experienced. Since species with similar life histories and ecological traits (i.e. those that define species’ ecological niches) respond similarly to specific perturbations (Murray et al. 2011; Wong and Candolin 2015; Melero et al. 2016), urbanisation can provoke fitness loss in many species if they possess traits that are maladapted to their new conditions (i.e. their original adaptive traits in natural environments are maladaptive in urban environments). By contrast, individuals of species with pre-adapted traits may be able to thrive in urban areas. Thus, an overall decline in trait richness could occur, leading to an overrepresentation of certain traits in urban communities (Lizée et al. 2011a; Sol et al. 2020). This functional homogenisation is often biased towards traits conferring wide niche breadths such as trophic generalism, dispersal ability, thermophilia and high reproductive rates (e.g. Piano et al. 2017; Merckx et al. 2018a, b; Santini et al. 2019; Melero et al. 2020).

The structure and composition of the urban landscape play a key role in the filtering of these traits (e.g. Blair and Launer 1997; Fenoglio et al. 2020). Indeed, the urban landscape is mostly composed of a built-up matrix, which reduces the abundance and connectivity of suitable habitat patches; furthermore, this matrix has a more serious negative impact on species distribution and abundance than matrices of (semi)natural areas (Blair and Launer 1997; Aronson et al. 2014; Oliveira et al. 2018; Melero et al. 2020). Urban green areas (i.e. potentially suitable patches) are usually small, isolated and greatly affected by the surrounding the built-up matrix (e.g. Verbeylen et al. 2003; Lizée et al. 2011b; Braaker et al. 2014; Melliger et al. 2017) and its surface area and composition (e.g. Bates et al. 2014; Tzortzakaki et al. 2019). Most research on urban homogenisation has linked environmental variables present in urban landscapes directly to community diversity and composition, or to species richness and abundance, without separating the specific effects of urban variables on the diversity of species traits (Ramírez-Restrepo and MacGregor-Fors 2017; Parris 2018). Yet, there is evidence that trait-specific effects exist in urban landscapes (e.g. Bates et al. 2014; Melliger et al. 2017; Iserhard et al. 2019). For example, the impact of connectivity and habitat composition may be greater on trophic specialists than on generalist species (Deguines et al. 2016; Wenzel et al. 2020), or on less dispersive species (Melero et al. 2020). Patch area mostly seems to influence species of small body size (Wenzel et al. 2020). Hence, whether individuals of a species succeed or fail in urban areas may depend on a combination of certain species traits and the specific effect that urban drivers have on them (Fenoglio et al. 2021).

In this study, we analysed how species traits and landscape factors combine to allow individuals of a series of species to use suitable patches in the urban landscape. Specifically, we assessed how the probability that an individual occurs in a urban patch depends on the effect that the habitat quality (in terms of its similarity to surrounding (semi)natural areas) and the size and functional connectivity of the patches will have on the combination of species traits. We clustered species into functional groups (see Materials and methods) since species traits are known to occur in correlation rather than independently (Eskildsen et al. 2015; Middleton-Welling et al. 2018). We chose the above mentioned landscape variables given that they are key factors determining species presence (e.g. Melero et al. 2020) and are manageable features of the landscape. Butterflies were used as model species because they are recognised as good indicators of ecological and biodiversity effects (Pollard et al. 1996; Thomas 2005; Merckx et al. 2013) and respond quickly to habitat transformations (Krauss et al. 2010; Ubach et al. 2020). As well, butterflies possess a range of traits that are representative of insects and other short-lived species, thereby guaranteeing a wide range of ecological variations and ensuring reliable ecological predictions (Thomas 2005; Carnicer et al. 2013; Eskildsen et al. 2015). Our study was based on empirical count data gathered by a volunteer-based citizen-science project started in 2018 consisting of regular surveys of butterflies in a series of green areas (gardens and parks, ‘gardens’ hereafter) in the city of Barcelona.

We hypothesised that (i) for all functional groups, the probability that an individual butterfly would be present in a garden will increase with the increase in garden habitat quality, size and connectivity; but that (ii) the effect of these landscape variables would increase in importance on a gradient from wide- to narrow-breadth niche traits (i.e. from generalist highly mobile and high reproductive rate species, to specialists with limited mobility and low reproductive rates). Indeed, we expected that individuals at the extremes of these restrictive traits would be rare or even absent from the city.

Materials and methods

Study area and data collection

The study area was the city of Barcelona and its immediate conurbation, consisting of natural, (semi)natural and urban areas, resulting in a total of 12,600 ha of study area. Barcelona has c. 6,600 ha (52.4% of the study area) covered by a dense urban matrix, the rest of the study area corresponding to the south-eastern part of the Collserola Natural Park—3500 ha (27.8% of the study area) known to be important for their species source effect (Melero et al. 2020)—and to 2500 ha of built-up areas in neighbouring cities and suburbs (19.8% of the study area; Fig. 1).

Fig. 1
figure 1

Study area including the urban area of Barcelona, the adjacent sector of the Collserola Natural Park and the neighbouring towns. In green, the Natural Park; in orange the 24 urban gardens studied with their ID numbers (see Online resource 3). In yellow, the three discarded gardens

Sampling was done by volunteers participating in the citizen science program urban Butterfly Monitoring Scheme or uBMS (ubms.creaf.cat), which consists of regular adult butterfly monitoring surveys from March to the end of September covering the flight period of most species in the area. Surveys were performed along 300-m transects within selected gardens following the standard ‘Pollard walk’ methodology (Pollard 1988). A total of 39 volunteers monitored 25 gardens in 2018, the first year of the project, and 24 gardens in 2019 (total number of different gardens = 27). Although our statistical methodology (Multinomial choice model) allows for unequal sampling, following a conservative approach we chose to discard from our analyses gardens with low survey efforts and only selected gardens monitored weekly, biweekly in two non-consecutive weeks or once per month during at least one of the study years. This selection resulted in a total of 24 selected gardens, comprising 318 ha of the total 335 ha of public and private gardens included in the program. The size of studied gardens ranged from 0.49 to 68.69 ha (mean = 13.77 \(\pm\) 15.23 ha; Fig. 1).

Landscape variables

The edges of the studied gardens were digitized on up-to-date (2018) orthoimages generated by the Cartographic Institute of Catalonia. Then, land cover composition of these gardens was inferred from a land-cover map (a 5-m cell grid) obtained from the combination and reclassification of the Copernicus Urban Atlas (https://land.copernicus.eu/local/urban-atlas), the land cover map of Catalonia MCSC 2015 (https://www.creaf.uab.es/mcsc/), and the Spanish SIOSE Land Cover Map (https://www.siose.es/).

To gather garden habitat quality, we used a proxy based on the similarity of garden vegetation to the (semi)natural areas where butterfly species richness is greatest (catalanbms.org/ca/habitats/) given that previous research has highlighted the importance of native flora for many butterfly species (Graves and Shapiro 2003) and because our aim was to test the role of habitat quality on the functional groups rather than species-specific. Vegetation per garden was surveyed in situ and categorized into values ranging from zero to three according to the following criteria: 0: no vegetation cover; 1: non-native spontaneous and ornamental vegetation; 2: isolated native plants embedded within non-native vegetation; 3: continuous native vegetation. We then calculated the habitat quality of each garden as the weighted mean of all four categories, i.e. the sum of the (numbered) categories multiplied by their area divided by the total area of the garden:

$$Q_{i} = \frac{{\sum {\left( {C_{i,j} \times A_{i,j} } \right)} }}{{A_{i} }}$$

where Qi is the habitat quality of the garden i, Cj is the vegetation category j (0–3), Aij is the area of that category j at each garden i, and Ai is the total area of the garden (Supplementary Information Fig. 1a and Table 1).

Table 1 Estimated coefficients, their mean, SD (Standard deviation) and 97.50% credible interval bounds for the probability of an individual to be present in a garden in relation to the standardised landscape covariates

Garden size was assessed using three different metrics: (i) total garden area, including vegetated and non-vegetated areas; (ii) ‘open’ vegetated areas including grassland, shrubs, crops and ornamental vegetated areas known to be important for butterfly specialists from open areas (Ubach et al. 2020); and (iii) ‘closed’ vegetated areas, with stands of trees or isolated urban trees, important for butterflies adapted to closed areas (Suggitt et al. 2012; Ubach et al. 2020; Supplementary Information Fig. 1b, c and Table 1).

Connectivity was calculated for each surveyed garden in relation to all vegetated areas outside the focus garden, including the surveyed and non-surveyed gardens and the adjacent natural areas in the city. We used the 5-m land-cover grid with grid squares categorized as either vegetated (i.e. belonging either to open or closed vegetation categories) or non-vegetated. We then calculated the connectivity of each study garden using a modification of Hanski’s index (Hanski 1998) that calculates the total of vegetated areas weighted by their cost distance to the garden edge:

$$C_{i} = \sum\limits_{{j \ne i}} {p_{j} \times exp\left( { - \propto \times d_{{ij}} } \right)}$$

where Ci is the connectivity of the garden i, pj is each vegetated cell j outside the garden i in area units (0.0025 ha), and dij is the cost distance from the edge of the garden i to the centre of each vegetated cell j. Given the importance of the urban matrix in the dispersal of individual butterflies (Lizée et al. 2011b; Melero et al. 2020), we calculated the cost distance (dij) using the Euclidean distance (in m) to each vegetated cell j, weighted by a resistance value assigned to each land cover category based on previous studies (Lizée et al. 2011b; Fernández-Chacón et al. 2014; Lizée et al. 2016; see Supplementary Information Fig. 2 and Table 2). To assess the connectivity for diverse maximal distances of butterfly dispersal, we adjusted \(\propto\) (the slope of the exponential function of Ci) to generate a value near zero (0.001) in the exponential function of the model using three maximum dispersal distances (d′: 200, 500 and 1,000 m; Supplementary Information Fig. 1d, e and Table 1).

Fig. 2
figure 2

Predicted probability of presence for each individual butterfly (coloured circles) in each garden in relation to the: habitat quality, open vegetated area, closed vegetated area, connectivity at small-scale (i.e., 500 m) and connectivity at large-scale (i.e., 1 km) (standardised values). In yellow C2-sedentary intermediate specialists, in salmon C3-forest specialists and in grey C4-mobile generalists. To reduce superposition a + 0.05 jitter was applied to the covariate axis for the clusters C2 and C3. For each cluster, each individual observed (N = 3545) is multiplied by the 24 potential gardens, giving a total of 9888, 29,784 and 45,408 probabilities for each cluster respectively. Predictions for each variable were based on fixing all the other covariates values at their mean. The size of the circles relates to the number of observations from one (smallest circles) to 100 observations (largest circles)

All seven patch and landscape variables were tested for significant correlations, which allowed us to select five uncorrelated variables: garden habitat quality, open vegetated area, closed vegetated area, and connectivity in buffers of 500 m and 1000 m (all five r < 0.62; Supplementary Information Table 3).

Species traits, functional grouping and statistical modelling

We chose seven species traits known to be important in the behaviour and ecology of butterflies and in invertebrates in general (Stefanescu et al. 2011; Melero et al. 2016; Moretti et al. 2017; Merckx and Van Dyck 2019): adult habitat specialisation, larval specialisation, voltinism (i.e. the number of annual generations), overwintering stage, species temperature index, mobility ability and habitat openness preference (full description in Supplementary Information Table A1 of the Appendix 1).

These seven traits were used to separate the species into functional groups based on the co-occurrence of traits within species (Eskildsen et al. 2015; Middleton-Welling et al. 2018). Clustering was done using all butterfly species known to occur in the Mediterranean area of Catalonia, to which the study area belongs, in order to subsequently extract the cluster for each of the species observed in the sampled gardens for the modelling analysis. In total, 152 butterfly species are present in Catalonia, a figure that excludes rarely seen species (< 20 observations over the past 24 years; catalanbms.org, Vila et al. 2018).

Hierarchical clustering was used to group these 152 species according to similarities between the species-specific values of their traits (species listed in Supplementary Information Table 4). We applied a Hill & Smith principal component analysis, which performs a multivariate analysis with mixed categorical and continuous variables (Hill and Smith 1976). The best clustering method and optimal number of clusters were then determined following the criteria of elbow and silhouette graphics (for a complete explanation, see Appendix 1). Clustering was done using package ADE4 in R 3.5.3 (Dray and Dufour 2007; R Core Team 2020).

We used multinomial discrete choice models (multinomial regression models) to analyse the probability that an individual butterfly would be present in a particular garden. Multinomial models account for the ability of individuals to make choices based on gathered information, that is, that an individual i (from a total of N individuals) will select a patch (i.e. the gardens in our study) from a finite number of alternatives given the characteristics of the chosen patch, the alternative non-chosen patches and the individual (e.g. Vardakis et al. 2015; Melero et al. 2018). Thus, for each detected individual within the 24 gardens, the response variable was the garden in which the individual butterfly was observed (the choice), while the explanatory variables of this choice were related to the characteristics of the gardens (garden habitat quality, open vegetated area, closed vegetated area, connectivity in 500 m and 1000 m buffers) and the individual butterfly (the functional cluster it belongs to) (see model details in Appendix 2).

The model was fitted in a Bayesian framework using a Markow Chain Monte Carlo (MCMC) procedure, with the Package ‘MNP’ (Imai and van Dyk 2005). All independent continuous variables were standardised to reduce standard deviation. We set the Gaussian with ‘infinite’ variance, which are the default non-informative priors and drew 1,500,000 MCMC Gibbs samples, discarding the first 500,000, and retaining one from every 100 iterations for storage-saving purposes and predictions. Finally, we ran two independent MCMC chains, starting from over-dispersed values, to diagnose their convergence with the Gelman-Rubin statistic from package coda (Supplementary Information Table 5; Gelman and Rubin 1992).

Results

Functional grouping of butterfly species

For the set of 152 Catalonian butterfly species the divisive clustering method gave four as the optimal number of functional groups (Appendix 1). Cluster C1 (N = 62, hereafter C1-sedentary specialists) consisted of the least mobile species with the lowest reproductive rates, and the most specialist species in both larval and adult stages. This cluster included species that overwinter in the egg or larval stage. Cluster C2 (N = 58, C2-sedentary intermediate specialists) included species of low mobility, mostly overwintering in the larval stage (only 15 species overwinter in the pupal or egg stages). In terms of nectar sources, the species in this cluster were less specialist than those in C1, and were either uni- or multivoltine. Cluster C3 (N = 19, C3-forest specialists) was the only cluster composed of multivoltine forest specialist species (i.e. with preference for closed vegetated areas) that were also generalists of intermediate mobility. The cluster C4 (N = 13, C4-mobile generalists) consists of highly mobile multivoltine generalist (both in larval and adult stage) species, with great temperature tolerance (Supplementary Information Table 6).

Of these 152 species used to create the four clusters, 36 were observed in gardens in the study area (total of 3545 individuals). No species from group C1-sedentary specialists were observed; 14 species and 412 individuals (11.6% of all observations) of group C2-sedentary intermediate specialists, 10 species and 1241 individuals (35%) of C3-forest specialists, and 12 species and 1,892 individuals (53.4%) of group C4-mobile generalists were observed (Supplementary Information Table 7).

Landscape effects on contrasting functional groups

Although the probability that an individual butterfly would be detected in a garden varied between gardens and functional groups, the average probability that an individual butterfly would appear in a specific garden compared to any other garden was 0.042, in a range of 0–0.361 with a median = 0.02, which demonstrates that some gardens were more attractive to certain butterflies than others. These preferences also varied between functional groups: C2-sedentary intermediate specialists and C3-forest specialists both had a lower median appearance probability of c. 0.01, while C4-mobile generalist butterflies, the most frequent species in the gardens, had a median appearance probability of 0.02 (Supplementary Fig. 3).

C2-sedentary intermediate specialists were positively affected by large scale connectivity (1 km) given that one unit of this large-scale connectivity increased by c. 33% the probability that a C2-butterfly would appear in a garden (effect size = 0.34, CI = 0.1–0.73). Connectivity also increased the probability of appearance of C3-forest specialists but at a lower spatial scale (500 m), and these species were more likely to be found in gardens with forested areas (i.e. closed vegetated areas) and less in open areas. Lastly, the most frequent, i.e. C4-mobile generalist butterflies, were independent of the landscape except for a negative effect of garden habitat quality determined by our proxy based on (semi)natural native vegetation (Table 1; Fig. 2).

Discussion

Using a volunteer based project in over 24 urban parks and gardens, we provided new evidence of how the urban landscape affects species presence in urban patches, and how this relationship is mediated by species traits grouped into functional clusters, a combination that has hitherto been generally overlooked in research (but see Delgado de la Flor et al. 2020). Although no functional C1-sedentary specialists were recorded in the city, a similar number of species from all other clusters were found; i.e. the species richness of C2-sedentary intermediate specialists, C3-forest specialists and C4-mobile generalists was broadly similar (14, 10 and 12 species, respectively). Both the raw abundances and the probability that individuals were present in the gardens declined as species mobility, reproductive rates and trophic generalisation all decreased. In fact, C4 was 4.5 and 1.5 times more abundant than C2 and C3, respectively. Our findings reveal that while overall species and functional richness are lower in urban environments than in natural areas (e.g. Biard et al. 2017; Merckx et al. 2018a; Fenoglio et al. 2020), the number of species in the different functional groups are similar. However, abundances differed between the functional groups, largely due to the lower likelihood of the presence of individual butterflies from the C2 and C3 clusters. High species abundance evenness has also been observed in terrestrial arthropods and bird species (Piano et al. 2020; Sol et al. 2020), which is potentially related to species traits (Sol et al. 2020).

Our hypothesis that more suitable, larger and better-connected gardens would favour the presence of all species independently of their functional group was partially fulfilled. Connectivity had no significant effect on C4-mobile generalists but its effects did increase from mobile generalist species to sedentary specialists (i.e. for C3-forest specialist species and C2-sedentary intermediate specialists), supporting the key role of connectivity for less mobile species in urban environments (Braaker et al. 2017; Delgado de la Flor et al. 2017; Melero et al. 2020). Indeed, for these two clusters, connectivity was the only (for C2) or main (for C3) factor determining their presence. Connectivity for C2 needed a larger spatial scale (1000 m) than C3 (500 m), even though C2 species were less mobile than C3 species. This result contrasts with previous research showing that smaller scales of connectivity are required for less mobile species (e.g. Merckx and Van Dyck 2019), probably due to the (semi)natural areas acting as a source of butterfly individuals. C3-forest specialist butterflies also preferred closed to open vegetation, as is the case of Pararge aegeria (Linnaeus 1758) and Gonepteryx rhamni (Linnaeus 1758). Of all groups, the C4-mobile generalists were least influenced by landscape characteristics and were the most likely to be present in any garden, as was to be expected since their traits (e.g. dispersal ability, trophic generalism; see Merckx et al. 2018a, b; Melero et al. 2020) are common in urban areas. A dominance of mobile generalist species in urban gardens, whether as city dwellers or transients, has also been observed in arthropods (Delgado de la Flor et al. 2017; Delgado de la Flor et al. 2020; Melero et al. 2020), birds (Bonier et al. 2007; Croci et al. 2008) and mammals (Santini et al. 2019). Despite the little effect that the urban landscape had on these species, there was a negative effect of garden habitat quality, which we attribute to the fact that in our approximate definition of habitat quality (associated with overall garden naturalness) we awarded low quality values to ornamental non-native plants. However, generalist species frequently feed on some of these plant species, in both larval and adult stages. For instance (Graves and Shapiro 2003), species of the genera Vanessa (Fabricius 1807), Pieris (Schrank 1801), Iphiclides (Hübner 1807) and Papilio (Linnaeus 1758) are all highly attracted to the non-native ornamental plants frequently planted in urban gardens (e.g. Buddleja davidii (Franchet 1887) in Barcelona). Thus, ornamental non-native vegetation can provide good habitat for generalist species, a finding that we failed to consider in our definition of habitat quality. A key strategy in further research that might help explain this counterintuitive result would be to use species-specific habitat approaches based on detailed information regarding plant resources (i.e. the amount of cover of all plant species) obtained from specific vegetation surveys.

Overall, there was no single set of garden characteristics that favoured all functional groups equally and simultaneously. Nevertheless, our results indicate that highly connected gardens are the most likely to harbour all functional groups, including the least abundant ones (C2-sedentary intermediate specialists and C3-forest specialists). Increasing the presence of these two groups, especially C3, will require combining areas of open and closed vegetation in gardens. Indeed, habitats with varied vegetation structure offer microhabitats that are suitable for a greater number of species (Sarthou et al. 2014; Sivakoff et al. 2018). Therefore, it is the combination of the barrier effect of the urban matrix and garden isolation (i.e. connectivity), together with the vegetation characteristics, that seems to not only shape butterfly richness—as previously observed (Lizée et al. 2016; Tzortzakaki et al. 2019)—but also the community composition of species based on their traits.

Worryingly, the C1-sedentary specialists were not present in any of the gardens and as such we were unable to analyse the trait-landscape interactions affecting them. It has been shown that garden isolation due to urbanisation creates an ecological barrier that prevents species lacking the traits required to overcome dispersal challenges (i.e. mobility or larval trophic specialisation) from colonising successfully (Braaker et al. 2017; Sivakoff et al. 2018; Melero et al. 2020). The lack of C1 species and the low abundances of C2 and C3 paints a picture of overall community homogenisation and impoverishment in urban areas that has been observed in other studies of other groups (Beninde et al. 2015; e.g. in birds and butterflies, Aronson et al. 2014; Olivier et al. 2016; Merckx and Van Dyck 2019). In fact, our study revealed that these factors cause there to be almost 58% fewer butterfly species in the city than in the surrounding (semi)natural areas, a very similar value to that found in Belgium for butterfly species richness (59% lower in urban areas; Merckx & Van Dyck 2019).

Conclusions for practice

Our findings demonstrate that any increase in urban biodiversity will require a diversification of functional community composition in terms of the key species traits and how the landscape affects them in different ways. Management actions need to target increases in species with no or low probability of presence and abundance in cities. Therefore, initial management efforts should concentrate on the low-occurring groups (C2-sedentary intermediate specialists and C3-forest specialists) by improving the connectivity between the city and (semi)natural areas; this will facilitate migration between suitable patches and promote population establishment in city patches whilst these species and those currently absent (C1-sedentary specialists) attempt to overcome the colonization barriers imposed by the urban matrix (Melero et al. 2020). Further research could explore how different species use urban green areas and their flora (e.g. for breeding and feeding) and how this habitat use relates to species traits. Nevertheless, further data is needed if this line of study is to be followed.