 Hello, this is Hans van der Kwas senior lecturer at IHG Delft Institute for Water Education. In a previous video I've showed how to make pie charts of land cover per subcatchment. There has been an upgrade to the data plot leak plugin, which enables to match the colors of the legend of the pie chart with that of the land cover map, which makes interpretation much easier. So in this video I'm going to show you how to do that. Let's first go to the plugins manager and verify that we have the latest version of the data plot leak plugin and that it's enabled. You can see here in the changelog for version 3.7 that it has this added feature, which is really useful to match the colors with the legend for the histograms and for the pie charts. So let's also remind us about what's in the attribute table. So we have the land cover and we have the percentages and we have the dn numbers which represent the catchments. Now let's first go to the colors and copy the html notation of the colors to a text file. We need that later. Now let's go to the data plot leak plugin and there we can set the plot type to pie chart. Make sure that you have the correct layer, in this case the intersected one and we want a subset per subcatchment here. So the dn numbers and the first subcatchment is number 0 and here we can see all the numbers from 0 to 4. So the grouping field is land cover and the y field is the percentage and now you see here the marker color and the stroke color and we're going to overwrite the marker color. So data defined override, go to edit and there we can build our expression and it expects a certain format that's written there and we're going to create that format using the color numbers that we previously copied. So we need this function mapGaD and it uses the map function inside that and then we can make these pairs of land use, land cover category and the color. So that's basically what we're going to do now and because I used the order of the legend I start with artificial and map it to the color that we have saved in the text file, copy that, should be a single quotes and a comma and then we do that the same for the other categories and with the bracket for map and then we need to add comma and land cover so it knows from which column or which item that's used in the pie chart and we close it with the bracket for the mapGaD function and then we click OK. Change some of the other settings so the plot title, land cover of subcatchment zero, keep the rest as default and then we can click create plot and now we see that the colors nicely match with the colors of our legend and we can do that also for the other subcatchments so I simply have to change the dn to 1, make it for the next subcatchment, clean canvas. I also want a horizontal legend now change the title and create it and there I have it also and we see here that in that subcatchment agriculture is dominant and then urban there are no wetlands and no water bodies. I hope this was useful if you like these videos please subscribe to my youtube channel and for more free materials go to www.igdelftopencourseware.org