 Hello, it's already recording, so I'm having some technical issues over here, so I'm going to close a few programs down and start again, and hopefully that will get us sorted. Hi, it is already recording. I don't know who started the recording. There we go. I'll mute my speaker. There we go. And we sorted. Hi. Hi. Yes, I can hear you and you can hear me. This is good. That's nice. I told you it was already recording. I didn't know who started it, but it was already on when I entered. Okay, that's fine. That's fine. Shall I... Let me just see what happens if I launch this again. And make sure that I can still keep the audio going. Can you still hear me? Yeah. Okay, and you can still see me, which is good. Because then it's just a little hack so that I can still see what I'm sharing screen wise. Let me just share the screen. We go, hopefully. Yeah, can you see the presentation? Yes. Okay, good stuff. Yeah, it's working. Nice. Okay, then I'm happy that is working. Thank you so much for wanting to help me. I really appreciate that. Okay, yeah, nice to do. No, it's good. Because it's, I think there's like 100 people who have signed up on the system. Oh, that's me. Let me just talk about that. Yeah, I think we've got 100 people signed up on the system. And so we'll see how many come because I think people have kind of bookmarked it as something to come back to you sometimes rather than something that they want to attend. But we'll see. Yeah, but this load of managing 100 people on my own while also talking was terrifying. So, so yeah, I'm really grateful. Of course. Yeah. Yes. Yeah. Yeah, as well. No, last year I wasn't here. This is my first time. No, I asked. Oh, no, it's gone. I had the echo. I was wanting to tell you that yesterday I also went to two workshops. And the interaction went really nice with the chat. Okay. Not very, very, very chaotic. That's reassuring anyway because you never really know what to expect. But yeah, hopefully that will, that will lend itself to a good session for us as well. Yeah. Okay. And I think the rules are just made to start when, when it's time. Yes, the most of them wait a minute till the message dropping in. Yeah, okay. And yeah. Great. I guess most of the people are on mute when they enter. I think you can set the settings, not sure. Okay. Yes. Looks like I can. I think that will be useful to set them on mute. Yeah. Do you know how to manage that side of things. And I do not have the authority here. But in the box and there should be. Sometimes you can see stuff where you can handle things like this, but yeah, not seeing it. So I guess I do not have the authority to assume. Yeah. I think you can see. It says I can, I can claim host. Yes, you are. I think you are host, but you have to host code. You have host code. So, should I claim? Who am I claiming it from? Yeah, it just means you get the extra authorities to, to set. Place people on mute. But maybe the organization did that. Yeah, yeah. That's already in the meat is actually an organizer. I don't know. He was already in it. Okay. Yeah. That's cute. And do you, do you have the option to claim host? And you see that as well. No, you don't. Okay. I can't make you host. Yeah. Because otherwise that would be the easy way to do it. And keep your rights on how you say your first name. I grew up in France. So to me it looks like Martin, but how do you say it? It's not too bad. Martina. Okay. Yeah. Great. We'll see. There's a lot of material in this workshop. Yeah. So many slides that you have. Yeah. Many slides. Hopefully it won't be too overwhelming. I tried to make sure that it's a, it's a step by step thing. You know, each bit builds on the bit beforehand. So if people get stuck, they can, they can go back. Yeah. Do you have breaks? Yes. Yeah. We're going to take three, 10 minute breaks. Um, just so that people can, people can work on their own plots and they can have a look at how it works and. Yes. We'll get a coffee, you know. Yeah. No, it's nice. I ran some of this material in a local ladies group. Um, a couple of weeks ago. And, um, I think actually being online and having the breaks online makes it less intense because people are free to go for a walk or come back and, you know, switch off or get a coffee. Whereas if you're all in the same room, it makes that more difficult to do that well. Yeah. Yes. It's different. And one of the workshop. He was yesterday. When it was a break, he stayed in the, in the meet for questions. So people had questions. And of course it was answering them. So I, I didn't dare to leave because I would miss the answers to the question. Yeah. We'll probably do a bit of that here as well. And I'm going to say to folks that they can, they can send me a plot if they want. And I'll try and give some feedback. Oh, nice. So we'll, we'll see if I can make that work. Nice. Yeah. I just really enjoy those interactions. Like it's just, it's such a nice thing to be able to see. And I feel like when you're, if you're the only person in your organization that's working on visualization, that can be quite isolating. So it's really nice to be able to have these conversations with other people that are interested as well. Yes. It is. Are you one of the, a few people that are in your company? Well, I'm self employed now. And yeah. So it's just me. Yeah. Yeah. So yeah. And in my previous job, it was a very small team. So it's nice to. Meet people from teams in different, different places and try and form connections there as well. Yeah. How about you remind me where you work again? I work at the university of applied sciences and. Researcher. Yeah. All the time with our. And I'm very interested in making my plots more comprehensible to others. Yes. It's a lot of work. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Well, hopefully this will have some good tests for you. Yeah. It's stuff that I use all the time. So I'm kind of sharing a bit of my. The behind the scenes stuff. That I use. So hopefully people will. Well enjoy it. Yeah. People start to. Yeah. Hello to everyone who's joining us. I'm just gonna. In the chat. And a link. To the page on my website that has got a link to the slides. And. A list of packages that might be useful. So people can. Take a quick look at that if they want to. Yes. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Yeah. Right. Any text path is such a nice package. It's lovely. Isn't it. Yeah. I use it quite a lot. I used it in. Was it one that I was doing for some academics. I had a paper with it was just some line. You know, three lines with the margins it with the. Error bars on either side. And so incredibly instead of doing real error bars and real lines. the variable was actually written on the line which made it easier and then I used segments that so I could stagger them a little bit so that you could actually see which error bar belonged to which you can see the error bars in full rather than them overlapping with each other. It was a nice little trick. So yeah yeah that's fun. Hello there. Hey Carolyn, how are you? Good how are you? This is I'm actually on Carolyn's Zoom. My name is Rachel. I'm just going to rename myself here. Sorry about that. That's fine. So I am going to go ahead and make you a presenter here. Okay. Okay so you should have co-host privileges now. So the session is recording obviously. You'll be responsible for running the session so kick it off whenever you're ready and you can utilize the Q&A which is what we would recommend rather than the chat just because it's easier to keep a track of. You can also pose as well if you'd like to and you should be able to share your screen now. Yeah and would you like me to just do that? Yeah that'd be great. You already could share your screen. Yeah. Yes I was sharing it earlier so hopefully. Perfect. So did you have any questions before the workshop? I don't think so. I've never actually used the question and answer thing. I've only ever used the chat so is there anything you need to tell people about how to use that? I don't think so so really just directing people if they have questions to go in the Q&A. We would recommend that you do read the questions out loud just because we are recording this and so anybody who watches the recording later on. So just read the question. You don't necessarily have to say who answered or submitted it but you can if you'd like. Yeah and then just it will go into open and then maybe at a break that you choose you could go in and mark things as answered just to help you keep track of questions that come in. Okay that's great and I've actually got Martina here who's kindly volunteered to help me with the questions as well. Is it possible to she have access to that and can she do a bit of the marking? Yes let me so Martina I just put you as a co-host let me know if you can see the Q&A. Yes I can see the Q&A. I could already see that. Okay great let's see here so if we should. Yeah access only host and co-host can see the questions. Okay great so Q&A is on and we should be all set so unless you have any other questions you feel free to kick off whenever you'd like if you want to wait just another minute or so you're welcome to do that as well. Okay great thank you very much. I think a few people are still joining us we'll give them a few minutes at the top of the chat if people want to have a look at that I've put a link to my website where you can find these slides again and the list of packages that might be useful and you want to code along with us today and as I said we'll just give folks a few more minutes before we kick off. There's a few more people joining I think but we'll make it start in a few minutes we seem to have stabilized near a third of the number that said that they were going to come so let's make a start and people can join us as and when they do. So first off thank you so much to everybody for joining us this afternoon or this morning wherever you are it's an afternoon for me today we're going to be talking about leveling up our plots and little tips and tricks that we can use to make sure that the main story in our plots really comes across as intended to our audience and let's just share a wee slide as we get going as a word of introduction so I'm Cara Thompson and I'm a data visualization consultant and I've ended up here through a love for patterns in music and in language and a fascination with how the human brain processes all of this and I was privileged to do a PhD in psychology gosh over 10 years ago now and really enjoyed learning all of that process and seeing how the brain responds to unexpected things that it comes across in music and language and from there I went into the analysis of postgraduate medical exams and spent about a decade doing that and trying to get across to busy surgeons what was going on in the exams in a way that they understood it quickly enough that it wasn't taking up too much time in the meeting but that it was it was clear enough that they knew what to act on and and from then I became a data visualization consultant really focusing on that that visual storytelling that we can do with our data which I believe is a great shortcut in helping people grasp your story but also helping people remember your story and so we'll talk about ways that we can make it memorable as we go today and there we go and the thing that drives me in all of this is helping others maximize the impact of their expertise the goal for today is to equip you with some design tips and coding tricks to make the most of color and text when you're creating your visualizations hopefully that's what you've come here for if not you might be in the wrong workshop but I'm hoping that you're here and that even if you're in the wrong workshop that you will stick with us and learn some really useful stuff and we're going to explore how to be a bit less dependent on annotations by using colors really well and we're going to illustrate ways in which we can use color and fonts to add some text hierarchy which just helps all the important bits of text stand out and above the stuff that is less important and we're going to apply all of the above to create some story-enhancing annotations and we'll talk about packaging up reusable bits of our code whether that's a color scheme or a theme for our plots that we can then reuse and avoid copy pasting them all over the place in our code base. I'm going to introduce you to GG text and Geon text path which are two packages that I use a lot in creating annotations for the plots and I'm hoping to give you some feedback on your own plots as well if you're game if you send me some stuff that you're working on then I would be more than happy to chat about that as well but housekeeping before we get started and rule number one please ask for help and I've been trying over the last year to teach myself JavaScript just as a new thing to learn and I've been reacquainted with how frustrating it is to get totally stuck on something that you know must be really basic but you're stuck on it and don't do that in this workshop if you're feeling stuck reach out in the question and answer they're in the chat and we will do our best to to get you unstuck so that you can make the most of the rest of it and just do we note here say thank you to Martina who's kindly volunteered to keep an eye on the chat on the questions and so if she's the one that gets back to you she's not overstepping I've asked her to do that I've also given her a license to interrupt me if it seems like something's gone wrong with the technology or if there's a really pressing question that a lot of people are confused about so thank you Martina for for doing that I really appreciate you taking on that role we're going to take regular breaks to apply what we're learning to our own plots and so every now and then I'll give you 10 minutes to go and work on your own plot we'll do that three times and feel free to either work on your plot or to go and grab coffee you know whatever you need to do to help you process this we're here we've got three hours ahead of us if we want to use all the three hours and it's a lot of information so take the stuff that you think is useful and work with it and just make this workshop work for you you know the game really is that by the end of it you should have greater confidence in the plots that you're creating and that you should have a better version of a plot that you've come here with if you've brought one with you and as I said earlier I'm more than happy to give a bit of feedback because if you want to email me a plot you can do that during the breaks and I'll do my best to take a look and I get back to you and throughout the code I'm using namespacing so I'm getting the name of the package then the double colon and then the function and I'm doing this for two reasons one it'll help you see where I've got my functions from if you want to retrace the steps that I've taken and two it's just good practice when you're writing code I would really encourage you to do this and it avoids you getting conflicts between packages where you you know you load if you load your packages in a different order you can get a different results which is which is frustrating to troubleshoot so recommend that you do this in your own packages in your own code but I'm just staying it here to make it easier to follow along choose your own pipe and we've got the option of the old one or the new one I quite like the old one so I'm going to stick with the old one in the code but feel free to choose your own pipe and if you want to and reuse as much of the code that I'm going to be sharing as you like and that's what it's here for and the whole point of these workshops is that you should go away with a good toolkit that you can reuse and so yeah go ahead and do that if you like see there's a question there about downloading the slides you can't download them but you can view them and share them they're HTML slides and so they're all stored on GitHub for you to use if you want so let's get started and we talked earlier about being less dependent on annotations by using intuitive colors what does that mean those of you who've come from the world of linguistics or psychology might have come across this question which one is buba and which one is kiki and there's a fairly clear international consensus but the one with the really sharp edges and the sharp spikes is kiki and there's something about the the way that we hear these sounds and that we think about them that makes us identify these shapes with names and this is this was a term of sound symbolism was was coined by Wolfgang Kohler back in 1929 and and it's something that is still being researched today and the number of shapes has increased the number of arbitrary names has increased but people are still fascinated by this phenomenon of sound symbolism and and what drives it and what we're going to try to do here is play a quick game to illustrate how we can use color symbolism in our plots not to make our plots into a guessing game but to help people very quickly see and remember what the main pattern is here so we're going to play a game which is based on an adventure for which I require you to suspend all disbelief the penguins a couple of weeks ago decided to run their own version of the bake-off and they set themselves a challenge of creating the tastiest banalove and we're going to do a little bit of their story I've made some plots and I'm going to ask you some questions and and so if you would like to take part in this game there is a bar of chocolate to be won and Martina is going to keep track of our answers as best she can you will need to type into the chat either a b or c in response to the questions that I'm going to be asking so fingers on the buzzers here we go and the great British and sorry not great British bake-off the great penguin bake-off so the penguins as I said had a baking competition to see which species could make the best banalove and each species was given given a different type of banana bananas of different level of ripeness and so if we see just this plot here there's not much that we can tell from it but and if I change the colors a little bit and which species do you think was given the overripe bananas so either a for the edelis b for the chinstrap or c for genzi excellent people are going for it so the overripe bananas yeah exactly this seems to be a consensus around c so that was the the brown color represents the overripe bananas and then the edelis penguins they got the green bananas they decided to experiment with different quantities of banana in their mix and each island of the edelis penguins decided to go for a different quantity and which ones had the strongest concentration of green banana in their cake and a b or c yeah a great that's really clear in the chat everyone's getting that one right brilliant yeah we need to have a bit of a pause between the questions because i don't know where the answering started for this question oh sorry yeah yeah that's fine and I think that with that one we started with a whole bunch of a's so much we see the consensus of a's that'll be that one okay tell you what I will type something in the chat demarcate them and next question they decided to go on a retreat to plan their bakes in different locations and so we've got an english countryside we've got the center of paris and we've got a ski resort which which species of penguin went on to a ski resort to plan their bakes yeah excellent this is working yeah lots of c's coming from the chat perfect and then we'll do the next question and they were allowed to invite a different mentor and so we do remember the mentors from the the bake off and we had mary very pre-leaf and paul hollywood so which species went with paul hollywood as their mentor for the bake-off challenge might be slightly niche knowledge yes excellent we can see the paul hollywood fans coming through in the chat very good so that was a you're recognizing the kind of silver hair and the blue eyes that made it into the the chart somehow and then next question and finally they were allowed to choose a different type of snack to enjoy between their practice bakes and so we have some fish and chips some sardines and some sushi which species went for sushi again a b or c a bit more mixed yeah b b is the sushi colors and i guess there's different types of sushi so then maybe that's where i went wrong with the colors of these but i think we've got a few more bees and then everything else and last bonus question which is about the baking duration so they bake their cakes for different amounts of time and here's the main durations per species and so i'm going to ask you about the comparison of these different baking durations and i think with this i find myself kind of putting my head to one side to try and figure out which one's tallest and which one's smallest and baking durations seem to work best this way around so which species took their bakes out of the oven first see yeah well done great well done everyone and so martina has hopefully kept track of who wants to do it it's just a bit of fun it's just the viral chocolate hopefully we can find a winner and we'll talk about that in the after our next break because it was a lot of time so they just told us that and so that brings us to the end of our round of great penguin bake off and hopefully it just tells us to illustrate this point of using colors well in our plots and with some purposeful use of color and orientation so that it's really obvious without us needing to say too much what's going on in our plots so without further ado let's get coding so we can apply all of this to some gg plots and i'm going to be using the tooth growth dataset and i'm using this one because it's built into art so you don't have to install any other packages in order to use it and and you can easily reproduce all that we're doing here and it's quite a fun dataset you know looking at how much the teeth of the green guinea pigs grew and according to whether they were fed vitamin c or orange juice and it's an excuse to use a cute gift at the start of the presentation which is you know always a fun thing to do and i'm going to share a few tips with you as we go and i'm using coder slides and for each and each bit of code i'm going to show the output next to it so you can see exactly what's changing in the code and what consequences that has for the plot that's coming out alongside it and i'm hoping that this is a nice way for you to be able to retrace your steps if there's something that you wanted to revisit it should make it really clear what what caused what so here is our initial plot and all we're doing and get our code link for the code and the code is all inside the slides and if you go to the link earlier and you can copy it really easily and but yeah i'll add the full code to my site afterwards i think somebody's not on mute if you could try and mute yourselves that would be that would be really helpful and so we've got the tooth growth dataset we're grouping it by supplement which is the video and see other issues and by dose and and then we are summarizing and to get a mean length of tooth that has come out from that and then we're plotting that as a bar plot and hopefully everybody's following up to this point and we're then going to add position equals dodge to put the bars next to each other rather than on top of each other because it doesn't really make sense to look at them on top of each other in this visualization i'm going to add a white outline around the boxes just to separate them out visually for us and make that outline a bit thicker using the size and and then my first mini tip is to get rid of abbreviations so we're going to go back to the data and within the data we're going to say that we're creating a new column called supplement and we're using case when so if you've not used case when before it's basically a nicer version of if else in which you can feed several conditions into it and you have true as the catch roll for if anything didn't meet the conditions that you're feeding in so we're going to say if the supplement was oj make it orange juice and it was vc make it vitamin c and that'll make our plot easier to read so let's see what's happened once we've done that well we also need to make sure that we change what we're feeding into the plot so previously we were feeding in sup and dose we need to feed in supplement and dose and then we need to make it sure a little bit coloring it by supplement and just by sup and then we have a plot that's the same but we have made the text a little bit less guessworky for our readers which is always what i'm trying to do next step is the minimal that would be my recommendation for a good place to start if you want to just get rid of that gray background which we all have grown to love with gt plots but minimal just gives it a little bit of a cleaner starting point and then we're also going to make the dose a categorical variable which i appreciate is controversial but because the research was looking at three different doses i think that's okay we get away with it this time around i will come back to scatter plots with people who are really concerned that i've done something terrible with summary data here and then i'm going to wrap it so i'm going to put the two sets of bars in two different facets and just create one column for all that so i'm separating out by supplement we've got oranges at the top and vitamin c at the bottom and then we're going to add in some text finally we've not done any other tasting yet so let's just add a bit of text in we have got a title we've got a subtitle and we've also changed the axis text so we're saying the dose and we're saying it's mean length we're giving the unit which is always a nice touch as well and there we have our very functional and basic plot which has all the information it needs to and we've created it and it's great but i'm finding myself feeling a little bit like this kid and looking at all the information there there's just a lot to process that you know the the text doesn't really stand out in a way that's particularly helpful and you don't really remember easily which one is at the top which one's at the bottom and i'm trying to compare them like that is all a bit mad so let's see how we can improve on this we're going to use color purposely and i'm going to start with some orange juice because we're talking about orange juice and vitamin c and that's nice and easy so orange great we can do that that's fine and vitamin c is also orange so we need to think about this one but i feel like vitamin c is slightly more red it's got a kind of more aggressive color to it and you can almost kind of taste the color when you see it so we'll try and find a more aggressive red to deal with and then i just thought this was a nice photo nice composition there's green leaves stand out nicely with these colors so that might be a nice color to use as the basis for our text and so what we can do at this point is go and copy the image and then we can go to image color picker and we'll say use your image and paste it in and from that we can click on the various bits of the box to grab an orange that we think is a nice starting point for our colors and we can grab a kind of more aggressive slightly redder orange for the vitamin c and we can take a nice bit of green that we can then modify and to create the colors for our test let's get back to the presentation and see what we can do with that so i created a package a while ago called monochromos because i was interested in the idea of how we could blend different colors together and how we could create color palettes it went from one to another and also it went kind of darker and lighter so that's the package that i'm using here and we're going to use our orange juice 5909 which i think is just a brilliant hex code for the orange juice color and then i'm starting from one of our darker bits of orange and i'm blending in some red and that's giving us a kind of ready orange color in the middle here which we're going to use for the vitamin c and then as i said earlier i quite like that green and how it stood out with the orange so i'm going to use the green as the basis for our dark text and so this isn't black it's just slightly off black but in a way that ties in nicely with what was in that photo and then from that darker color which you can see the hex code here is the same as the one that we're starting with here i'm going to go lighter and to give us a bunch of different grays that we can use for the lighter text in our plot see everybody's still with me and how we've done that so we've grabbed some colors that we liked and then we have manipulated them using monochrome to make sure that we have a set of colors that all work together that are based from that that original image and here's what we're going to be working with so this is our vitamin c palette and creating a named vector in order to apply this to the plots i'll come back to why that's important to do but for now you can see we've got the orange use color and we've got the vitamin c color we've got a lighter text color and a darker text color and that will help us add a bit of text hierarchy to our plots so back to the plot and let's add colors in a question about monochrome package does it display colors of that yes it does and that was partly because i could never remember the magic incantations that you were supposed to call in order to bring the colors up in the viewer and so yeah monochrome of view palette is the function that you need in order to do that and the handy thing about this is that it's a ggplot object so you can then feed it into color blinder which checks for how it looks for people with different visual perception i'll come back to that again later but yeah and hopefully other people will find it as useful as i hope you would so here we go we're back to our plots and we're going to add our colors into it the easy way to do that is just to add scale fill manual and to type in the colors that we had decided on earlier and that's great but it's a shortcut and it's a dangerous shortcut and i'm going to show you right and here is the scenario you have created your plots you've got it all nice and sorted and then you've gone on and you'll leave and in the meantime some keen being in your team has spotted that actually oh no catastrophe supplements should have been a factor i've just reworked that for you i've made it into a factor and i've changed the levels and wait a minute if you now look at the plot it now says that the vitamin c is the color that the orange juice was and the orange juice is the color that the vitamin c was keeps your eye on the plot and you can see that the the bars and the legend are flipping around just on the basis of the the facts that have been added there so we don't want that to happen and the way to safeguard against that is to use a named vector instead so you remember our vitamin c pellets and is the vector that we were using and that had orange juice equals the orange juice hex code and vitamin c equals the vitamin c hex code inside it and so once we've done that everything is restored and from we see we've got vitamin c associated with the right color and the orange juice associated with the right color and again now we've also got some other colors in there that we're not interested in seeing in the plot we don't want to give people the like text and the dark text and the legend so we'll come back to how we rescue that later but the key advantages of doing this you always know that the colors are applied to the right data points and you keep your color data pairings consistent throughout a project so you can reuse that vitamin c color palette on all of the plots you don't have to copy paste any hex codes anywhere which is great because then if you decide actually I don't like that orange I'm going to make it you know purple or whatever and you only have to do that in one place and you can those of you who are interested in writing packages you can package up the palette you know anything that you create and you can't add into a package so that's that's one thing that we've done in the past and and you can also reuse the colors in the text with a little markdown and I'll show you how we do that in a bit as well so there we go we've got our named vector we've got our colors ending up in the right order and we're going to use limits equals force to get rid of those x colors because we don't want those to be inside the legend the limits equals force just means it doesn't use it doesn't add into the legend because they're not being used in the plot and then we're going to use the transparency of the bars as a proxy for the quantity of banana that was added no not banana we're not on the banana anymore but let's do a bit of mincey and orange juice that these guinea pigs were being fed but the job we're doing that is that the the most faded bars become really difficult to see so we want to control the range of the transparency and and we can do that again using scale alpha and as you can see here so this sets the lower end of the transparency as point three three and the upper end as one which makes it easier to still see the lightest of the bar and and then finally we're going to make sure that the dose is nice and clear and you don't want to have to keep looking up the tooth growth data sets and help in order to figure out what this is so we're going to add a function into the labeling of our x axis so the function is fairly straightforward when we take x and we paste x and milligrams per day because that's the unit that was being used and and once we've done that we should end up with 0.5 milligram per day one milligram per day and two milligrams per day check that's what we've got and it is but it's small that is there trust me and we've got the units printed in there again which is helpful and then we're going to get rid of that legend it was always redundant because it's just fascist and so we don't need the the legend in there we've got labels elsewhere not some people have very strong opinions about legends if you absolutely want to keep it absolutely fine by me i'm just trying to show you how you can try and declutter as much as you can in your plot and and finally i'm going to flip the coordinates because i find it so much less confusing trying to compare the length of the bars this way around your eye is much easier able to draw the lines here and see that this one sticks out past the second one here and that this bottom one sticks out past the bottom one here as well it's just all about making it easier for your readers to do the comparisons that you want them to do so that they can then remember the story that's associated with your data so there we go it's so much clearer already and we haven't even done any annotating other than adding in a title and a subtitle hopefully you're all on board that that was a worthwhile exercise and just looking at some colors that resonate with what it is that we're looking at and you know without reading the labels you know that the top one is orange juice development vitamin c and you can then remember the story much more easily and from that point onwards i'm going to hand over to you and in a little bit but first i'm going to give you some tips before i get you let you loose on choosing your own colors because that's going to be your first task to go and find some colors that you want to use and in your plots and it's just important to remember that it's about making it easier to remember what's what and so you might not be doing research on something that has a really obvious link like that you know you're probably not looking at orange juice and vitamin z in getting face and so we might need a bit more conceptual work to go into those colors but i just wanted to be clear that i'm not trying to turn your plots into your guessing game all i'm trying to do is reduce the cognitive load for your readers so they don't have to keep checking across with the legend and while they try and read what the plots are but picking colors is really hard i find it really hard to and so my top tip is to let other people help you and here's how you might have some brand guidelines or some department guidelines that you can fall back on when you're designing your plots and creating a color system for yourselves and they will rarely have the semantic associations that we've just talked about but they can be a good starting point and particularly if you want to use monochrome to blend in a bit of your department color to the the semantic colors that you're coming up with that can give it all a nice unified look and what i like to do is start from a photo and or a piece of art and something like image color picker to pick out the the colors that are there and obviously that was a very literal example that we did there so and it was also very literal earlier when we were doing our penguin bake off and these are the photos that went into creating the plots and that we used to to guess where the where the things were going and which meant all the chosen and and so on and so forth but here are a few other examples this is a project where i was working with people who were looking at how trustworthy videos were seen to be based on whether they had been made by a human or whether they had been completely automated and so i created a machine color which is that kind of steely blue and a human color which i kind of thought of as a kind of pinky brain you know orangey pinky brain color and which is the kind of colors that you see a lot if you google images of AI and and then i fed that into monochrome to end up with three colors because they also had a middle condition which was whether the video was partly automated and partly human made and and i think this helped when you saw the graphs it helped you see very quickly which one was which and if nothing else it allowed me a little chuckle as well about more machine now than that but don't make what is it evil and twisted twisted and evil plots we're all about making our plots nice and clear and for for our readers here's another one that i did February something for a company called recast and when i've got their logo on there so you can see what i did i first found a color that was the color of their logo and then i blended a little bit of the color in there this was a company that was looking at financial forecasting and they wanted a color for sales so i went with the kind of gold money coming in they want something for growth so i went with green but again blended in a bit of their logo color and something for loss and again that color ties in with the rest of it so that when people were seeing their dashboards it was really clear very quickly and what they were looking at and finally this is a project that i really enjoyed working on just very recently for someone who was based in british columbia and so i took a photo from there and tied the various colors in with you know who's the different participants were again in the dashboard whether it was in the old system the new green system people who who were taking the view from the top of the mountain or people who were kind of more on the grounds and got that kind of orange brown and the kind of darker blue colors that were associated with those as well so it's not always something that's as obvious as the bananas and the orange juice in the blue and sea but hopefully it still anchors things in a way that people can easily identify what's what and remember it even if it wasn't initially obvious without you having to explain it and sometimes you might be in a situation where you don't know how many colors you need or where the colors just don't really tie in with anything in that case consistency is going to be your key and as i said take inspiration from photos or other data viz or even some art that you like and not that i'm at all obsessed with the bake-off but here is a part that i made recently and all the colors in that plot are based on this photo which i think is possibly one of the happiest photos and that you can find online you've got a lot of colors from prized shirts that made it into the the icing then you've got the actual icing that i think is based on the icing in Jürgen's little bowl over here and and on top of that you've got a bit of a tent coming into the background as well and hex so thank you for your question you're asking are they going nice we're making color pilots color bind accessible yes and we'll talk about that in just a minute and here's another one that i've been working on recently again the research group doesn't know necessarily how many colors they're going to be needing and so it was a question of finding a group of colors that worked well that scaled well for accessibility as well and that reflected nicely the ethos of what they were looking at so i'm going to talk you more about this in a couple of days in a lightning talk about database design systems if you're interested in finding a lot more about that you can also use google images and look for whatever you like call it so being based in edinburgh i thought i should give this ago and here is the edinburgh color palette and it's quite fun to see that dolly the sheep is the first color that made it into that and festival blue is something that we'll be seeing a lot more of over the coming months and they try anything you know sunflowers or peacocks or you know whatever it is that you that you like the color of and someone will have come into the the realization that there's a good color palette to be made from it and then you can start basing some of your plots on that and as well if you really like the purest approach and we'd rather start from the color wheel and read around how best to use it i highly recommend this blog post that i've linked at the bottom here and from data wrapper on how to use colors well in your plots and using a tool like palette on really helps and let me just show you what that looks like a little load there we go that's fine and so here is the tool and you can say you need three colors you need them related you need them differently you need four colors and when i first started looking to this naively i thought that the most based out your colors were and the easier it was going to be to to create a good plot and that actually you end up looking a little bit like a nursery or a primary school in the in the branding of that what happens is if you tie you bring the colors a little bit closer together and you still get some nicely distinct colors but they're a bit more you know thrown up in the way that they they work with each other which i think is a nice touch or something to consider but as i said have a look at the data wrapper blog post that i've linked there because it's one of the best ones that i've found on all of this again quick tip for viewing your colors and we talked about this earlier monochroma view palette which as i said spits out the ggplots object and make sure that you name them as well and a few things to bear in mind accessibility so thank you Hector for using that for mentioning that that's a really important point we need to make sure that our plots are readable by people who've got different types of color perception and and there are ways that we can test that there are a few tools that we can use if you want to stay within the art world and ColorBlinder is a great package for doing that it's no longer i think accessible and available on cram but you can download it using the the github install from the creator's github page and if you go to that github page there's instructions on how to do that if you've not done that before and but yeah what it allows you to do is feed the gtplot that you've just created into this function and and it spits out plots that mimic what these what your plot would look like to people who've got different types of color perception and so i i recommend using this because sometimes you create a palette that works well and on an online tool and there's a few you know chroma chroma.js i think palette checker i'll pop a link to that later as well and but you can sometimes it looks great if there are clear blocks of colors but if you're making it as a scatter block for example and your dots are quite small suddenly it's less easy to see what's going on so i recommend trying to actually simulate it with your your plot and seeing what it looks like and color contrast dot cc is also really good when it comes to looking at text color against background and it's quite a fun interface where you can kind of see that obviously the black text here against the the white is failing and on all counts but you can you can move things around and try and rework it until it passes on all the levels maybe line green isn't what i would recommend as a background for your plots but yeah all options to explore so accessibility is important and the other thing to bear in mind that i would highlight is if you're doing things to do with race and ethnicity obviously avoid stereotypes and be mindful of unintended messages and say for example the logo from your organization is green and i would maybe avoid making any of the groups that you're talking about the green color and your plots just because that will highlight them and standing out for the others although if your organization is one that is particularly looking to work with a particular group of people then that would be a perfectly fine thing to do but just be just be aware of how your colors might be interpreted by the people viewing your plots and finally color intensity i would say more is more so if you're wanting to show there is more of something go for a more punchy color and if there is less of something and then you can go for a more faded less intense color and so i'm going to hand over to you guys at this point for a quick 10 minute break and where i'm going to ask you to think about the concepts in your own data and try to find some images that you think are related to these concepts or if you don't think that's something that will work for you and try to find some images that you like and that fit nicely with your own aesthetics and extract the color goes that you need using image color picker or another tool if you are used to using a different one and then name them and check what they look like together using monochroma as we looked at earlier and then try to assess them using color binder mcd grid as well so without further ado you have 10 minutes i will kick around if anyone has any questions feel free to pop them in the q&a and or in the chat and obviously if you have a plot that you're made to take a look at then there'll be some in the email as well yeah let's start these 10 minutes grab yourselves a coffee and go and find some images that you like and we'll regroup after that okay we have a minute left so if you're still wrestling with your colors now is the time to stop the soul searching and make a decision and you can always make another decision again in half an hour's time okay we're at the end of the break hopefully those of you who want to get coffee in our back and with us i hope that was helpful for you to just get a bit of time to process what we've been talking about and and yeah apply it hopefully to your own your own plots and martina has managed to figure out who won a great penguin bakeoff game so martina if you could announce our winner that would be great yes the very clear winner there was one person who was three times the quickest with the correct answer and that's Katie then excellent well well done Katie and if you could email either me or martina and we'll sort out the details for how to get that bar of chocolate to you wherever you are in the world and hopefully that'll be a nice little souvenir from from this workshop but yeah thanks for thanks for playing and the second thing that we're going to talk about now in this workshop is how to add some text hierarchy to our plots and that text hierarchy is one of those things is so much easier to demonstrate than it is to explain so take a quick look at this and this image has text that is formatted in different ways and the way that the text is formatted draws your eye to some things as being more or less important than each other and the big text is something you're going to be reading first but it's not just about the size of the text it's also about colors and it's about italics it's about where the text is placed and so on and so forth and what we want to do as people who create data visualizations is harness this so that we are making the main story of our plots stand out to the people who are looking at them you remember the plot that we created earlier it was just a little bit busy so we're going to go back to that and see how we can rework that and to rework it we need to start playing with theme and so the theme function is about the ggplot package and you can modify basically anything that you want within your plot i take part in the tidy Tuesday challenge which has been a great way of creating all sorts of zany plots but it also shows you just how to manipulate pretty much everything that you could try to manipulate within a plot so if those of you who want to level up on your plots i highly recommend taking part in tidy Tuesday as a way of doing it with plots where you can very rarely put your foot in something serious so we've got our basic plot which is the one that we created earlier and i've just created a basic plot object that we can call and continue modifying and that's just so that it's easier when we're looking at the code it doesn't get too cluttered with all the code that we've already read so here was our basic plot and and we have theme minimal already and that's part of the plot there and what we can do is build on that by adding more theme arguments so the first thing we're going to do is just actually get rid of the legend by using legend position equals none and then we're going to change the color of the text now this is really subtle here so keep your eye on the text and you'll see it gets a little bit more faint and with that second slide and we're using the light text color that we created earlier as part of our vitamin c palette to remember we had the orange juice the vitamin c dark text and the light text so we're just using that and feeding it into element text and then element text applies that color to all of the text inside our plot and and we're then going to override that in the title and to make the title slightly darker again i appreciate this is really subtle and at this stage but then we're going to start doing some more fun things so we can change the size of the text and to make the title bigger highly recommend using relative sizes and especially if you're going to be using plots that you're creating in different spaces and you can use the relative size and it changes the size of everything compared to a base size that you feed in at the start so this means that if you suddenly realize that in all their plots the the text is just slightly too small you can change the the base text size inside element text and i'll show you how to do that in a minute and and all the rest of the sizes will adapt accordingly so don't go and set absolute sizes otherwise you have to change your code in the most most different places and we're going to make the text bold in our title again to make that stand out and we're then going to add some fonts and so i'm using cabin as the font for most of the text and then and ricketta for the font for the the title and again just to add a little bit of variability in there once we've done that we can we now understand the principle so we can apply it to the strip text which is the title of our facets so again we're using the light text we're making it bold we're making it slightly bigger changing the font and and we're also doing the same thing with the axis text now i said earlier the element text changes all the text in your plot the trouble is the theme minimal has some opinions about what color text should be as well so if you're using theme minimal as your starting point oh this is we're getting cool apologies for that um so if you're using theme minimal as a start it has some um colors that are inside it and so you want to overwrite them again in your access access text which is what we're doing here um so that's that sorted and then the important thing at this point is to acknowledge that choosing fonts is really tricky i think most of us that have gone into data visualization have not come from a graphic design background but thankfully there are lots of graphic designers around who provide some really really useful resources that we can fall back on so as i said earlier you might have some ground guidelines and within your department that you can use someone would have done a bit of thinking about which fonts work well together and but you need to make sure that these fonts work well in the context of visualizations you don't want it to be either fonts that are too narrow or too wide and and you want them to be easily readable so it's worth thinking about the types of fonts that work well in user interfaces for example where you typically have quite a lot of information and that needs to be really easy to see and so you've got your fonts that you can choose you can also have a look at what other people have used in their websites and and use the inspector tool for those of you who are not familiar with that it blew my mind when i first saw it so i'm going to pass on that favor you right click and you have a look at inspect and and then once you've done that you can type in here and and that brings up the fonts that people are using can we see the inspector tool over the zoom Martina keep me right um there should be a bunch of code at the bottom of the slides yeah you can see that okay great so um again if you find yourself on a website and you think that's a nice combination um you can have a look at that i really recommend Oliver and as a person who provides great resources on this he's got a good font matrix and works page that helps explain why fonts work or don't work together and he has quite a nice newsletter as well which suggests on fonts and if you want to really become a font nerd among your peers in data visualization some of us would see that as a badge of honor but it's probably to be debated and getting custom fonts to work in art can be really really frustrating so i'm going to acknowledge that and but things have come a long way recently so if you have tried to do this previously and just find yourself and not getting anywhere um then there is hope um on the horizon so system fonts has changed things quite a lot um and the way that you're supposed to do it is you install your fonts locally and then you'll probably need to restart our studio once you've done that just so that it's aware of things and have the system fonts packet installed and when you install that it should also install um rag and text shaping and then you need to set set your graphics device to a gg and cross your fingers and everything should work fine i've done a bunch of troubleshooting on this so again a few steps so that you don't have to do that yourself here is what i mean by setting your graphics device and so you will find inside your studio options in your general options and the option to change the graphics device here with this little dropdown um so have a look at that and make sure that you've got a gg as you're setting and that'll make your fonts play nicely um if you're using um fonts inside a markdown or a quarter document again this took me far too long to troubleshoot so um this is a quick solution for you you need to add dev equals rag the score png to your um starting chunk you know when you set all your options and start every markdown document and again that means that you don't end up with the frustrating thing of your plots making absolutely fine in the viewer and fine when you gg save and not rendering with the fonts in your markdown documents or your quarter document and i'm not entirely sure why the mechanics of it but i know that this is the solution so hopefully that will get you right and but you can still end up filling a lot of affinity for ron swanson and in this scene as he chucks out his computer and if you're there and or if you just want to find out more about using custom fonts highly highly recommend this post by june show about using custom fonts in r and yeah he's just put some really really useful tips there on things that i did not know you could do with fonts um that's uh yeah again stuff to play around with but mostly stuff to troubleshoot where you are if you're just trying to use a font that's not not working so at this point in the presentation we've got a set of fonts that we're using and we've got a set of colors and a few rules and as well and so we're really halfway towards a database design system which is a set of rules that you can follow so that all your plots look on brand every time and you've already considered the accessibility and side of it and i'm going to be talking about that again in a few days time and i've popped a link at the bottom of the slides that link is not live yet and i will add something to it tomorrow and to make sure that it's there with the recording of the talk but you will um by this point you know you've done a lot of work to figure out this plot and it's quite rare in a research project that you would only be creating one plot you're probably going to be creating several of them so it's worth saving you some energy by making those decisions about which colors you're going to use for what which fonts you're going to use and then you don't have to revisit that every time you make a plot and if you're doing it in R then you can implement it so that it all happens with a couple lines of code as well which is which is really good fun and and again we've got accessibility we've got meaningful colors within the context we've got a bit of visual identity which is helpful when you're publishing across lots of different outlets it just kind of brings everything back very clearly into your team and as I said you can implement it as as an R package which is good so um once we've created our plot we've changed the title font and the text font and we've got a good amount more text hierarchy going on here than what we had at start but we can give everything a little bit of space to breathe so you can change the line height within your title you can give your title a margin and it goes top bottom left no top bottom right left I think no top top right bottom left trouble is the way that I try and remember it clearly that didn't work out but trouble is the way to remember it so yeah crbl and to get the order of your your margin sorted there and you can get your plot subtitles sorted in there as well you can apply the same kind of thing to the axis text and to the strip text and we can also get rid of the y title we don't really need it to say dose on the side there so we can just get rid of that and again we can change the size of the title but watch out because there is just gone off the edge of our plot and so we need to make sure that we figure that how to fix that and the old way of doing it is to add a whole bunch of line breaks in which actually is what I've done and if we look at the code and created two line which is one line breaks it goes onto two lines but that's not the best way to do it and what you should really consider using instead of doing all of this because if you don't have any line breaks it just goes straight off the edge and is GT text so there's so many reasons to love the GT text package and and one reason that I discovered fairly recently is that you can use element text box simple and as a way to wrap your title within your plot and the same for the subtitle and now you have to be a little bit careful in terms of the margins to make sure that you don't get two boxes that overlap with each other and the way that you justify the text etc but it just saves a whole bunch of time figuring out where should I break that line and because it breaks the line for you in a way that makes it all fit inside the plot so consider using GT text and text box simple and for your next plot just to save some of that extra thinking that you have to do and also if we're using GT text we can have some fun with HTML and CSS so I'm not going to go too crazy here we're just going to change a bit of formatting in our title text and but I'm just demonstrating how we do it here so the bit that's formatted like code is just code and then the bit underneath it is how it renders so you can see the first word green here is this one and all we've done is encased it inside and a full span and then full span in which we change style to say color is green and we can change other things so for this one here we've changed the font size and to 60 points just to show you what it looks like and you probably wouldn't want to do that within a title but what we can do is use the colors from our vitamin c palette to put the word orange juice in the orange juice color and vitamin c and the vitamin c color and it's a nice touch and it makes it again a little bit easier when you're orienting yourself with the plots that you can see okay these colors are deliberate and that's good and you get a feel for what the data is going to show and then how it relates to the colors inside the plot and as well so we can do that and see for yourselves this is how far we've come with these little tips and of adding some text hierarchy it just it's more inviting you know you look at the plot and you don't run away thinking that's too much text you want to read the text that's there and I think as humans we're I was telling with somebody in the chat there about the strip effects and the fact that we are we just we're wired to read stuff we can't not read things and so we might as well make it easier for people to read the important information first when we are creating plots so I'm going to hand over to you again for a quick break and or for some fonts work and depending on which you think you need the most at this point in time and I'm going to ask you to apply the colors that you chose earlier to your plot see what that's looking like again if you want to send me something to look at more than happy to do that and you can check what fonts are on your device by using system fonts and and that will open up a data frame that you can view and you can filter to find the ones that you're interested in and if you want to install a new font you can do that and then you can apply once the title and you can change things inside the theme have a look at your different light and dark colors for your text using monochrome if you want to do that and apply all this have a play around with relative text sizes and do give me a shout and if you get stuck we've got a question from Roland about is it possible to add icons to our titles yes if you use gg text you can add emojis which is what I just did there but yeah it can get a bit messy so sometimes it's worth doing it sometimes it just distracts from what you're trying to do but yeah I'd be interested to see and what you have in mind and and what you do with that that idea that could be quite fun so hopefully Martina will there any pressing questions that I should answer um no there was one question about if you want to dive into a bit about making a package but you think that will come which package sorry now you have a few slides back here set at the bottom of the slide and make a package no a few slides back oh she slides back sorry yeah where were we keep going this oh this yeah yeah so implementing as an R package and so if you if you if you're able to catch my lightning talking a few days time I'll talk more about it then and but you can you can create a scale color you know cara or whatever it was that you want to create that will then add that into your package as you use it into your plots as you use them and and you can also create your own theme function that you can then apply I'll talk about that when we come back from the break so if you during the break get a theme that you're happy with and we will then package that up as a function and so that you can see how you can reuse that and across several plots and after that I hope that answers the question but yeah I'll try and populate this link that I've put at the bottom of the slide and then people can take a look at that as well and in due course yes it was answered to the question it's in the chat so that's nice okay um other question that's mine my question of me uh the font I see in your presentation is different than the one I see on your website yeah why and can we do something to make it the same yeah that's a good question so I I noticed that just before it started and I was like I'm not going to try and fix that just so we start but yeah that is to do with github pages and where github pages looks for a custom font and so if you're creating things with github pages it all it should all work well inside a document and but github pages for some reason looks for the font a level higher in the hierarchy from where the presentation is so I need to make sure that I put my custom font in the place where github pages is looking for it and that's the solution to that that problem there so it's not a system font thing it's a it's a github pages issue um yeah but thank you I will fix that that's helpful okay well let me get this starter the timer started and we've got 10 minutes and feel free to do whatever you need during the next 10 minutes and when we come back we'll package a few things up and then move on to um annotating the plot with trends and specific um data points that we're looking at okay we have 30 seconds left so if you can regroup we'll we'll get cracking with the rest of the presentation soon and I hope what we've covered so far has been helpful and do you give me a shout if we have missed any questions or if there's anything um that you think it would be good to to go over in more detail and yeah more than happy to fix up offline as well and if there are questions that we don't have time to to answer within the bounds of this workshop so hopefully you've had a chance to play around with the theme um function inside your plot um and we're going to talk now about um moving on from there so packaging up package development is a whole other workshop so I don't have time to show you how to make a package but I will say this it is much less difficult than you think it is and people think of package development as this thing that only the super hardcore nerds do um but that's not true it's it's not that difficult to do it if you know how to write a function and then you're most of the way towards writing your own package um I highly recommend um Shannon's blog post that I've um put the link to again at the bottom of these slides if you're interested in building your own package it's just a really great way of making it easy for you to retrieve um functions and objects for yourself and easily so I've done that for myself I can never remember what my brand colors are I mean why should I spend you know cognitive energy on hex goods so I've um created this and then it means that if I want to figure out what my colors are I just have to call that function from inside my package um which yeah it's fun um and yeah it is a lot easier than you think but yeah I think that you've created so far so you've might have created a color palette that you're using in your plot we will just talk in a minute about how to create a theme function and you can easily add those into the package and just follow the steps um that Shannon goes through there she's giving a workshop at the same time as me today and so I'm kind of gutted to be missing that um but it's another another voice that's well worth listening to um in the art world so in terms of um making things more efficient even if you don't want to create a package um you still might want to create a function because our current status is that we're calling theme minimal and then we're calling theme again and adding probably about 20 and 20 lines of code to that and and then what we want to do really um is create status where we can just call theme any pick so we just add one line of code um and that will um yeah that will solve our plot um text hierarchy make our colors consistent within our text and all of that and we have a question in the chat about including the data in package to share um yeah you want to be careful about what data you include um and how you're sharing your package with other folks and there are a bunch of um you know if you're just looking to create a plot theme um and color scheme I would just rely on the packages that we're using here to demonstrate how those work and when I create packages for clients what I tend to do is use the Parma Penguins um package for the data just to demonstrate what different types of plots look like with the theme that I've made for them and the color scheme that I've made for them and the penguins are my favorite but there are a bunch of different packages that you can use um if it's an internal package to your organization and then you're probably in a better place to be including some example data that's that's more relevant to the stuff that you're doing but just be really careful about where that package is stored and what the privacy is around that and in case you're leaking data that you that you shouldn't be leaking um yeah just something to be to be mindful of and all the built-in packages and the Parma Penguins data and make it easy to to do this kind of thing without needing to include any data inside your package so how do we go about creating our theme function and this is essentially here um the code that we were adding to our plot right all of this theme minimal plus theme change the legend change change the text color change the axes etc etc what we're going to do is we're going to encase that inside a function that we're calling theme guinea fates because that's the data that we're looking at and it's a kind of cute name and and this is the trick that I was talking about earlier we can give it a base text size so I'm going to say we're using 15 as the base text size and and then that gets read read into theme minimal as the base size which means that then any relative sizes that we are applying build on that text size so we've created a function here in which we can very easily change this the size of the text if we decide actually the text is a little bit small across all of my plots let's just make it a bit bigger equally sometimes you render a plot and you make you have a very small export and the text looks huge and you need to work it the other way around and as well and a good practice when you're writing functions is to not let it access anything outside of the function itself so we want to be feeding it the vitamin c palette so that it can then make use of it and inside so it's then calling palette pets color because we've said that is the vitamin c palette and again if you're not familiar with function writing this might be an extra step but it's worth considering and whether this is something that could really increase the efficiency with which you produce plots and for for your next project so at this point we also know how to get from here to here because that's what we've just done we've created our theme function so here's our basic plot and then just to test it out we're adding it to a completely new set of data and we've got a plot here that has the same kind of branding as what we had earlier so even just this step aside from the colors and allows you to quickly make sure that all your plots have a kind of visual consistency and that's not just the visual consistency of yeah okay that's a duty plot you know which is not the visual consistency that you're necessarily aiming for so we've done that we know how to create a theme package and again we can talk about that offline in more detail if that would be helpful the next thing we're going to try to do is reduce unnecessary eye movements so we talked earlier about not having to get our readers to consistently look between the legend and the colors to figure out what's what and we're going to add some text boxes in that will help us do that and so we're going to make it even easier to compare values here is our themed plot which again I've created so that we can build on this rather than including all the theming elements in our code and we're going to just change the gaps here have a look at the gaps between the text on the y-axis and the bars just a little bit easier you don't have to jump quite so far between the text and the the start of the bar and we're going to move the titles of our strip text so that it starts at the start of our bar again just to make sure that you're just looking in one place when you're trying to figure out what is this bar that I'm looking at and and then we're going to add in some text boxes and we're going to do some fun stuff here with some conditional alignment and coloring and such associate dots on we're going to be using gd text and tion text box so we have already told gd plot inside the themed plot that we created what was going to be the x and the y coordinates of our bars so we know the x is the dose and then the y is the mean length so we've already got that sorted what we want to do here is add a text box that just tells us what the mean length is that we calculated and within that group so let's see what that looks like so as you can see we've added a text box that kind of straddles the end of the bar and that includes in its label the value that corresponds to the end of the bar hopefully that's making sense to people and so all we're doing is creating a text box which sits at the y coordinates which indicates the end of the bar which contains the the value that's in there and we can then do a bit of formatting we'll make the text a bit bigger and we're going to make sure that we line up the text and the boxes so that they kind of butt against the end of the bar inside the bar using h line and h just and this is another one of these things that I made because I could never really remember what was what ever if you have a look at the alignment cheat sheet and blog post that I made it shows you where the boxes sit compared to the points that their coordinates and based on the alignments that you feel it so we want to make the text go to the end of the bar and then we can also take out a take the box console away by saying box color is na we take the background away by saying fill equals na and we have some boxes that are perfectly fine but I think we can improve on what we have here we can give them the same font as everything else we can change the color to white and we can make them bold so that they stand out a little bit more so that's all fine but we've got a bit of a problem with the lighter bar in that we can't actually see that number very clearly I would fail a bunch of accessibility tests so we need to make sure that we have a way of countering that we also could run into a problem if we were using a different dataset and say this bar was much shorter we wouldn't have space for the text to to fit in there so we're going to add a bit of conditional and jiggery bogey on this to make sure that our labels sit always in a nice place that makes it easy to see what's going on so what we're doing here we're using case when to say that if the mean length is less than 15 then we're going to align it one way around and if it's greater than 15 we're going to align it the other way around and we're doing the same thing with haline so the justification of the box and the alignment of the text inside the box are both going to be conditional on the basically how long the bar is so there we go so we've got for bars where the value is smaller than 15 the text is outside of the bar and where the value is greater than 15 the value is inside the bar and I've made them all black so we could see where they are because otherwise you would just get white text on the white background here and this would be very confusing and so look at hopefully the case when thing that makes sense you're just moving your boxes so they always sit in a place that makes sense we are then going to do some fun color stuff so we're going to say if the mean length is greater than 15 so remember that's when the text is inside the bar we're going to make the text white and otherwise if the text is outside the bar then we are going to use the color that corresponds to that bar so for a dark orange bar we would expect some dark orange text and for the orange juice bar we would expect the orange juice color for the text as well so let's run that and see what's going on and we do not get what we're expecting at this point so what's going on here what's happening is that a ggplot has decided it rightfully so that we have fed it some information here and we have actually just given it levels rather than giving it colors so it thinks that this here why should it interpret it as a color it's just a string of text and the same for the supplement that's inside the bit and see it doesn't know to use those as colors it just thinks that it's text so it's using you might recognize the default ggplot colors that you get if you were to feed three yeah if you was to feed three different levels of a variable into ggplot so we need to fix that and to fix that we just need to use scale color identity again hopefully this is a shortcut it took me quite a while to troubleshoot this the first time I played around with it but that means that it's taking the string that we're giving it so the hex clues and it's turning it into the color that it is using and within the plot so there we go that's what that looks like we've now got the text that is the right color for the bar and we've got it as white text if it sits inside the bar and which is yeah just another nice touch you know this is absolutely necessary but it's about reducing that eye movement making sure that the readers can see what the value is without having to jump between the x-axis and and what's going on at the top there we can then use our our markdown knowledge that we gained when we were looking at adding a span either side of text to format it and we can reiterate what the dose is and we can add a line break we can even change the size of the font so that this extra little bit of information in terms of our text hierarchy it's not the most important thing the most important thing is the dose but it's just a little nice reminder for the reader so they don't have to keep jumping back and forth to figure out what it is that they're looking at so that's a little bit what that does here we go so we've got some boxes with some text hierarchy inside them and which just reiterates to the reader what the dose is is the same as what's printed here but putting it over here just makes it easier to read they don't have to keep jumping back and forwards across the plot and the last trick that we're going to do on this is to use jumps around half up to make sure that we're rounding the length I didn't realise I needed this until I tried to demonstrate something clever that I'll show you in a minute and at which point I realised I hadn't rounded the values so we kept getting you know 0.33 recurring and which in the label looks really ugly so we're going to just round round the lengths and we're just going to round them and to the first whole number and just for a little bit of ease and yeah there we go we have the spot and at this point you might be thinking that's fine but why why don't I bother doing this I could do this in Figma I could just add the labels in on top or even you know MS Paint or whatever tool it is that you want to be using and that's fine oh we have questions if I move on do we think it's important to include the values on the x-axis if you included them in the bars good question and I think this probably is a personal preference thing and it might also end up being a journal editorial question that some people will have very strong views about the fact that you need to have you know it's a legend and the axis labels clearly and all that kind of stuff so this I feel is a nice touch yeah I would say you could probably get rid of it but it depends again how you want your readers to process the information if it's important for you that they kind of see three equally valid conditions along the the axis and oh I was thinking about the y-axis yeah in terms of the x-axis again you can get away with removing them or you could if you wanted to change the number of breaks and so you're not including quite as many breaks if you're including the the value inside the bars and yeah good question thanks Raymond and in terms of why why would you why less would you bother doing this you could very easily make your plot and then annotate it using a totally different tool and that's fine and this is to avoid that scenario where you your colleague comes to you after you've created all of your beautiful visualizations you've been really careful about your text hierarchy placement of the labels and they say you know what that participant we thought we'd lost their data we found it we found it we can add it back in we can we can recreate all the blocks with all this extra data or whatever it is that's relevant within your field of work and inside you know you will be thinking oh I should really be filling yes for science but no I've just spent so much time getting all my plots sorted I do not want to have to start all of these labels again and from scratch what we're doing here is kind of briefing you against that situation you're creating plots in which the labels will automatically update themselves when you get new data coming in this means that you can start creating your plots earlier on in your research project and you can get a feel for what your data looks like how you want to visualize it rather than having to wait till the very last bit of data collection has happened and obviously you'll want to wait until that to get your story straight but you can already start to work on your visualizations and save yourself a bit of time as you go that nothing that you do is going to be wasted when the final dataset comes in and here's just a quick demonstration what I did here is I created new data by just sampling the toothbrush data set so I took you know 50 random rows instead of taking the 60 that are in there and regenerated the plus and as you can see the the labels move around in the way that they would need to if you were to update your data and this is also really useful if you want to create parameterized reports I think David Kries is doing a talk on that in this conference as well and what you can just create a plot function which we don't have time to cover just in this workshop but you can then apply the same plot to different datasets which is great if you want to give different feedback to different candidates for example and or just keep going with different datasets within a research project if you have a report that you run every month and that you need to feed out some plots you can do this as well and get your annotations sorted and so yeah great that's a great comment in the chat it's always lovely to see the surprise of new colleagues faces when you make the changes as soon as they ask exactly is that thing it makes you a bit of a local superhero you know you can get these plots done you can get them all updated and everything looks great because you spent the effort at a time when you had the time to spend the effort to make them look good and it's not a last-minute rush to get them sorted so as I said it's easier than you think and it makes a really big difference hopefully this has been a useful thing to get to take a quick look at and it can make you a bit of a local hero and the surprise under colleagues faces is always worth it when you've had time to do yeah just time to invest in making sure that the plotting function is always going to work with the data now you will end up getting surprises you know you can't always guess all the different permutations of where your bars might end up but most of the time you it's a quick fix to get it to work if you've invested the time getting your labels in the right place so I'm going to hand it over to you again for a break and then after this is our last break okay so this is your last time that I'm going to set you working in your own plots and after that I'm just going to show you some fun tricks that you can try to apply in your own context so the task at this point is to try and add a text box or several to a plot that you are working on and try to add a bit of text hierarchy to that box and then see what happens if you just feed a sample of your data into the start of your plot code and see if everything moves in the way that it should move and hopefully you've got enough tips and tricks there go back to the slides and I'll paste that link to the slides again into the chat and if there are bits of markdown that you want to have a look at but here we go 10 minutes and then after that it will be the home straight to the end of the presentation with enough time for some Q&A and after that as well so see you in 10 minutes okay we've got seven seconds to go in your text box creations whereas that was a quick quick break after the previous one or it came quickly after the previous one but I just was keen to not overwhelm you with too much too many different possibilities as you said about creating a box for your plots and what I'm going to do in the rest of this talk now is to just show you different ways that you can use boxes and annotations and it's very much a kind of pick a mix at this point okay so take the things that you think you might want to use and have a look at them the code is all in the slides you can reuse that as much as you want to and that's how I learned by seeing how other people did these kind of things so go and reuse all of that and we're going to be talking now about the final point which is to highlight important patterns in your data and sometimes there are some interesting data points in and of themselves that it's worth highlighting and sometimes highlighting a particular point allows you to explain what the graph is showing in a way that just talking generally about all the points doesn't so for example I remember a plot there was a time series and it was really interesting and really helpful that the the plot creator had added an arrow to say this is a Monday and then you could see whenever that spike came back again okay that's a Monday that's what that spike means and he just highlighted one of them and rather than labeling all the Mondays as Mondays you just have to highlight one data point and that did the job and in explaining the story so highlighting important patterns there are lots of different ways that we can do it and people have done it in different ways throughout history as well we'll touch on that very briefly in a minute so in order to look at how we highlight important patterns we're going to go back to our penguins and see how they got on with their great penguin bake-off who made the yummiest penguin banana loaf and what type of banana was best and how long did they leave them in the oven and so on and so forth we're going to look at means within the species we're going to look at some trends and we're going to highlight some key data points and taking these all in turns and at this point in the presentation you know how to get from this plot to this plot okay you know how to get between these two plots we've changed the colors we've changed the fonts and we've changed the theme elements to bring in fonts that we wanted and add a bit of text hierarchy there as well so this I'm not showing you anything here that you don't already know how to do from the materials that we've talked about so we're going to build on this and add some labels into our plots so and one thing that you could think about doing is consider text boxes instead of a legend and so if you label your data points directly on the plot and then sometimes that's a lot easier to process what's going on in order to do that we're going to create a penguin summaries data frame so what we're doing is we're taking the penguins data we're grouping it by species and then we're finding the mean bill length and bill depth which are the two variables that we are completely misusing as baking duration and yumminess of the the cake okay so that's where that's coming from and so we're going to first find these two find basically in taking the means we're finding the the central point of the the data points that correspond to each species okay so we're taking within each species what is the mean for the x and what's the mean for the y so that we can put our boxes in the right place and on the plot and then we're going to add a bit of commentary so we're going to say if the species is a deli and then we're going to write some blurb about what the deli penguins did they were there was ended up with the the green unripe bananas and it turns out that that's not great in terms of yumminess in the way that we've plotted this data and gently they ended up with the overripe bananas and true remember that's our catch all and that's the chin strap and penguins so they had right bananas and took slightly longer cooking time let's just take a look what that looks like so this is the data that we've ended up with from doing that quick manipulation okay so we've taken the summary we've then got there's the means here we're going to use as our x and our y coordinates and then we've got some commentary and we've got the species that's still in there so we can take that data and add it into a text box so the rest of the plot is all created using the penguins data so that's the full data set what you can do with the text box is you can give it different data which you can do with other layers in a in a gt plot as well you can feed different data frames into different layers so here we're feeding in the summary data and and we are going to say okay for our label because we already know that we've got x and y sorted and because they're the same as the variables that we're using in the rest of the plot we just need to add in a label so we're going to use a bit of markdown and we're going to paste team and then species and you can see that turns into team gentu team chin strap and team deli and we're going to make that bold by using two asterisks either side and then we're adding in a line break which is what that little br is and then we're going to say you know the color of the text because color for our dots is the color of the the bananas it's pulling that color into the text so we need to override that for this kind of explanatory text that's underneath so the color of team gentu is brown because that's the color of the species which the whole plot is coloring and according to the type of banana and the kind of sentences do not make any sense out of context species and bananas and penguins and it's all a bit mad but if you've been following from the start hopefully you don't think that I've that I've totally lost plot and unintended so we get the commentary goes in and and we're going to feed our commentary but we're going to override the color to make that light text color so again adding a bit of text hierarchy and within labels so that's what these look like and from this point we can do a little bit more formatting so for this plot we're using dm suns as a basic font and we're going to change the size of the text you can change the width of the box you can make the box slightly transparent so you can still guess that some of the dots that are behind it and and we're going to remove a console of the box as well with box color box color equals na now I wouldn't recommend doing this if it's really important that your readers see all the individual points that are behind it but what this does allow you to do is very quickly paint a picture and if you're just looking at broad picture then this is quite a useful trick that you're putting all the information in the plot in a way that again reduces the eye movement and that makes it really easy to identify which cluster of points corresponds to which species and you're adding some extra story into it and the same time so it's not just a direct label of what corresponds to what you're also adding a little bit more as to the patterns that you found in your data and probably not to do with penguins but you never know and so that's one way of doing it another one that you can look at is geom text path and which doesn't work great in this plot and but what it does is it adds a label and within the line that corresponds to to the data and again with this one I tend to use geom text path and then set the start to smooth so that you get the line that is the equivalent of geom smooth but you can add a little label inside of that if you want to let's just check what I've done in terms of text yes I've just pasted team and then the species and because the color by default is the color of the species again it's automatically coloring the text and the lines that we're using within geom text path make that a little bit clearer I'm adding a rectangle behind it that spans the the plot it's a white rectangle and it's very transparent it's a bit of a hack to make the transparency so low and it's because of the way that we've built the plot and it's creating one of these for every data point so that's why we've had to put the offer so low and if you were going to do this the proper way to do it would be to feed your data just into the geom points and rework a little bit what we're doing this is just to illustrate what geom text path is doing here and hopefully you can see it well enough zoom isn't always the best for kind of fine detail and but we've got the team genti printed on there and it follows the line and it's just a nice way again of making it easy to see what's going on and you could add some narrative to that if you wanted to you know generally baking cakes for longer results in yummier cakes or something like that would be something that would apply within all of these data points and we can then do a bit of formatting again you could change the font you can make it bold you can change where the label sits within the line whether it's slightly elevated whether it's right in the middle and and you can with the vertical justification and then with horizontal justification you can put it towards the the front or towards the end end of the line again just play around with these kind of things and they might be more or less useful for your context but it's a useful trick to have if you do tend to show these kind of lines within your data and I should add this isn't anything new so these some of you might recognize play fairs work from you know the father of data vis as he's considered to be I had the privilege of seeing some of his work in the Edinburgh uni special collections and a few weeks ago if she ever in Edinburgh and fancy a really nerdy exciting moments and book yourselves an appointment with the special collections books they were absolutely brilliant with us and but what you can see here is he's got he's got it going he's got the the labels that move with the data he's got colors that are intuitively you know in favour is green against his red and we've got lines that go all the way through it that are consistently coloured and yeah annotations on the plot you know it's all trying to make it intuitive and reducing the eye movement and it's just really quite fun when you see something like that you think oh yeah that's John text path and obviously it's not it's him doing it but it's really fun that we get to reproduce these kind of effects in our because of all the packages that people are adding to the you've got ecosystem and the other option if you want to use the text path and you're not able to see the data and is to use text path with John label path and that creates a label behind it which just makes the text stand out and a little bit more and again you can do all the formatting on the text and Martina you're asking who that was that was William Playfoot and who yeah Raymond and I were just chatting about him actually in the chat and about the the work that he did and but we it's very very young database he think was there was some architecture and also some cartography and a whole bunch of stuff that was going into informing the way that he would present data visually and but really really fascinating and to to have a look at the stuff that he was doing those of us who were there in the special collections kind of all agreed that it seems too mature and to to be the first iteration of this kind of stuff but yeah it was just really fun to see how he went about it and also and to discuss the ways in which he manipulated the axes so you got to the x-axis that had you know it was a timeline but it was not consistent in its spacing and we had a good discussion about whether that was okay or not but we thought considering everything else that he'd added to our tools and tricks and we should we would let him get away with that but yeah it was it was just really good fun so anyway it's all like to say to your textbook great package and it's not necessarily a new concept but the package is really really good for for adding this kind of stuff and yeah yeah pie charts as well link to him and so we've looked at the the means and how the means species were doing let's have a look now at how we would highlight specific data points so how did our individual penguins get on so at this point we needed to do a little bit of housekeeping and the data because we need to use the penguins raw data rather than the penguins data and so don't worry too much about this what we're doing is making sure that the the variables in the penguins raw data line up with the variables that we're using the penguins data and just so that the the clock reads in the right variables and the names that are in the penguins raw data are quite different so we just need to make sure that they're formatted in the same way and once we've done that bit of tidy up we then want to find our star baker our runner up and the lowest score and the bunch okay so the star baker will be the one that has the maximum bill length because we're using bill length as our measurement and yumminess and and then the runner up is the one who comes second when we sort them and in decreasing order so that's the second best penguin in our bake off and then we want to find the one who did he got the worst score so that would be the one who has the the minimum value of bill length so we're finding our penguin highlights penguins that we want to keep and then there's a bit more has it has given me to do because the species names in the raw data are different from the species names in the penguins data there's just a bit more detail in them so all we're doing here is keeping the first chunk of the species name a little bit of regular expression if I can get it the first time around if I can't then I hate it it's really good fun I'm quite satisfying when you do get it blind on the first first attempt so we've got um yeah this is just explaining what that's what that regex is doing or regex and a bit of text manipulation again we are going to add some commentary about our individual penguins and we're going to use the individual id what species they are which island they're from and add in some text so we're going to find the star baker who's the one who has the maximum bill length and we're going to say our star baker is and they're going to read in that penguins id and and we're going to read in what species they are which island they're from and then say congratulations because that feels like the right thing to do and for our penguins we're then going to find the runner up and similar story again we're going to say what species they're from which island they're from and their individual id and then a bit of extra commentary that we can add because we know that both the ripe and the overripe bananas did all right in our bakeoff competition and then true this is going to be the the runner up penguin that's the only one that's left in this highlights data set and as we're going to say flag their id as I said it didn't have a great baking day add a bit of commentary onto that so let's just have a look at what that looks like so this is what the data looks like that we're going to feed into the next set of boxes so as I said we've got the id we've got the species we've got the island and then we've got the commentary that we've created by combining these things with a bit of extra text that we wanted to add in and this is the plot that we have so we want to figure out where we want to put our labels and so there's a bit of space over here that would suit quite nicely to highlight this top point here and we've got a bit of space here that we can use to highlight this point here who's our runner up and then we've got a good amount of space over here that we can use to highlight this penguin that was the one with the lowest score so we're going to add the coordinates of where we want these boxes to lie into the penguins highlights data and yeah I just sorted them so that it was easier to remember which one was which and then added the labels in like this and that's probably slightly lazy of me I should have done some more case when and said when the length was maximum the maximum length then the x is this etc but I thought for the sake of getting through the workshop without everybody seeing too much redundancies within the slides I would just take a bit of a shortcut here so we're saying where the x and the y coordinates are for the boxes that we want to add in and then we're also programming in the alignment within the box left to right so where we want that box to sit compared to the point and which is the same thing as we did earlier in our bar chart in terms of where we wanted the the box to sit whether it was inside or outside of the end of the bar and same thing here again so we're saying if the label is going to be yeah if the x is going to be that way then we want to align it this way and if it's going to be that way then we want to align it that way again you can step through the code and in your own time to to revisit this and then finally we're going to add in some arrows so we need to say okay we're going to start the arrow at the x and y coordinates that we provided just over here and then we want the arrow to end pointing towards the point that we're highlighting and again we're going to do a bit of conditional delivery pokery to make sure that the arrow stops just short of the point regardless of which direction it's coming from so that we don't have an arrow that ends up going to the long side of the point we're trying to highlight this will make so much more sense when we look at what it looks like in the plot trust me so this is the plot as we have it we've got the the means and the the bit of narrative that we added there and then we're going to add an extra text box in here which is coming from the penguin highlights data which we just created which contains information about the star baker the runner up and the penguin who did not do so well in the baking competition and same as earlier we can do some formatting we can change the the size of the text we can remove the backgrounds we can make sure that there is no contour to the box and then we're using these x y and left to right to position the boxes with regards to the dots that they are pointing towards and then we're going to add in the arrows and we're going to use geon curve to add the arrows in and again we're using the penguin highlights data and the arrows start at the coordinates of the box and the end at the conditional points where we had left them earlier which means that they should end just shy of the points that they're highlighting which if you look closely is exactly what's happening and which is quite fun so well done us for managing to do that and again there's a bunch of formatting that you can do for your arrows to make sure that they you know you don't want your arrow to be the main thing that people look at so you want to make your arrow fade into the background a little bit make it a little bit more transparent make it not too too wide and a little bit of a curve is quite useful and yes and then we want to make sure that we align the text inside the box so keep your eyes on the dots and you can see that the text is ending up getting aligned so that it is aligned towards the direction that you want to be looking in and again it's just a simple trick but it avoids you having too much trailing space there at the edge of your box if you do it nicely like that so again you might be asking why enough of a bother doing that I could just annotate it in something else here is the case for doing it that you can create yourself a penguin plot function and then feed it new data and the labels will adjust and to where they need to be now remember we hard coded where those commentary boxes were about the highlighted papers and you could and code those in such a way that those boxes would move around with the points as well and I just thought I would keep things a little bit more simple and so that we can keep track of what's going on but as you see this again makes the case for doing this kind of stuff in R and creating new plot functions in such a way that they update themselves when you feed them more data and so there we go there we have it we've leveled up our plots and we've gone from plots that were perfectly functional and contained all the information that they did contain to plots that kind of draw you into the story a bit more and that are going to be more memorable for the people that are reading them and we've looked at markdown tricks we've looked at job text tricks we've looked at and conditional alignments and I've hopefully made the case for a thinking a little bit about a database design system for your projects and be thinking about which bits of code you can package up and make and so in such a way that they respond programmatically to the the data that you're going to be feeding them and but the possibilities are kind of endless you know I've given you here some tricks that I've enjoyed using and ones which I thought we could cover in the space of the workshop but there are so many other things that you can do which is why I really recommend taking a look at the tidy Tuesday challenge and seeing how people customize the plots that they're creating there and reusing bits of that that you think are useful and okay there's comment here about customizable parameters but the documentation for most of it is really bad yeah I find the documentation is written by people who write documentation for people who read a lot of documentation I spent ages when I first started learning art trying to figure out what on earth food and bar were and why were they in the documentation everywhere it seems that they're just placeholders from strings of text and these kind of things you kind of the more documentation you read that is within the same field the easier it gets I mentioned the start that I'm trying to learn in a different language and I'm finding it really hard to understand the documentation within that so I think you do you do get quicker understanding it and the more the more you're practicing that but that's not at all to diminish the efforts that you've already put in and to understand it and I think one of the things that that I find difficult is the error messages that can be really quite hard to track back to to what's going on and yeah resources to explore the the parameters I would say I would I find it easier to understand what the parameters do by looking at will someone's done and seeing the outputs of the code rather than trying to understand it just from the documentation and so again if you try and follow if you put folks from within the tiny Tuesday challenge and see what they did with their plots and you can I found that really helpful in understanding how and yeah just how the plot functions work and what you can manipulate and how to go about it you know all this trick of reading in different bits of data for different layers and that's something that I got from there and as well so yeah hopefully that will that can unlock things a little bit and if you're getting stuck and you can also search github for specific functions and for specific strings and so you could have a look and see if you can find a repo in which that's been used and you can see what the outcome of that is as well yeah so the the other trick is to make things really ugly you know I tweeted about that the other day I was creating a table function for a client and I'm trying to add his own aesthetics into an interactive table so that he could then create any reactor tables that he wants to from any data that he wants and they will all look like they've come from from his consultancy and I just to try and get my head around it I made it really really ugly so I said you know I use the default colors of you know make this text red and make the background green and make the lines blue and you know just so that you can see really really obviously what's doing so I would say push things to to extremes where you can and and see in pushing things to extremes it will show you what what that function is doing and I restate the four guidelines that start with use color consistently I can try and so use color consistently and add some text hierarchy to your plots and try to reduce eye movement by putting text at a point where it makes sense to look and the fourth one that we've looked at there is highlights important patterns which will help you make sense of the data help other people make sense of the data really quickly yes I managed to remember what the four points in my of my workshop were I'm quite chuffed with that and great so I'm glad I'm glad people have found this useful and then that's really great to hear thank you for copying that in the chats but yes the possibility of the endless and I just you know play around these are the blocks that I made using the building blocks that we've talked about here and using um lego and using gg text and using scale and scale color density to look into the different lego colors that were there for that one well so they've done this is some kind of explaining models and looking at the light through the year you can look at different coordinates that you can use that's using the polar coordinates for this this plot here and which again kind of find out by seeing what other people are doing and if you really want to go silly you know you can use images and you can animate things as well which is quite a fun trick and not always super useful but you know why not I mean if you think it helps your data giant answers that you have sense of humor then it's worth doing these things so yeah we've made it and to to the end of the materials that I had well done everyone for sticking with it and hopefully that's giving you some useful tips and tricks that you can use in creating your own plots and I said earlier and I'll reiterate it again more than happy to interact and you know reach out if you have some any questions if you get to stop another thing and more than happy to try and troubleshoot that so again in touch and it'd be great to hear from you if you've got feedback thanks for some really nice feedback in the chat there that's really lovely to me thank you and yeah stay in touch I'm going to hang around in here for the rest of the chat for the rest of the session and we finished a little bit early which gives you a bit of a break before the next workshop but it felt like bombarding you with any more information would be just too much so yeah I'm going to hang out here feel free to hang out and see the questions that come up or feel free to yeah just head off and start calling your own plots but thank you so much for all your questions and for your participation it's been a really enjoyable workshop and thank you to Martina as well for keeping me right just giving me that safety net that I would make sure that I saw the questions that were coming in there so yeah you're free to go and I'm going to hang around and so yeah let me know if you have any more questions can you walk with silence oh I was going to pop a link to there's already a tiny Tuesday basically somewhere oh your next talk nice yeah there's a link to the next talk so if people wanted to find out more about and that's the database design system that I was talking about yeah I will put the link on my website I just couldn't get the video to work today but I'll I'll look at that tomorrow oh Nathan thanks that's a good point about case one and the dot default argument and yes I'm maybe using a slightly older version of case one and I think they did change the way that defaults were handled so that's helpful to point out thank you another case for reading the the up-to-date documentation yeah Martina I'm with you I keep the true I find the true one really helpful but then the updated case when deals better with n a's so previously I had to revert back to if else if I wanted to deal with to have n a's as impossible outcome of the case when presentations yeah you can use n a's but you have to choose the type of n a yeah which is which is I think an advantage rather than jumping back between case one and if else in times yeah it took me time to understand why it was true for the last option but then yeah it's yeah it's very logical so I really like them yeah yeah that's what's what's what's having great uh so nukta I think you typed your question to me directly instead of to everyone or to kara so maybe uh I can read it for you question kara from some nukta or are you here and you ask it yourself that's a question about could I ask about good data transformation practices to make plotting easier or is this beyond the scope of this session I found that I spent most time on this while making my plots and yeah I mean good data transformation it's it's really hard I think and there's actually a workshop that's happening at the same time as this and crystal nurse is part of that and she she to me is is um yeah I've worked with her on a few projects and her insight is how to do this well it's just running so if you have a chance to to catch the the replay of that I recommend it and I think yeah when you're transferring stuff into your plots I obviously try to leave try to do as little transformation as you can and because you don't want to be changing your data and but you can you can change what comes out the the other side of the pipe and so yeah it's worth making sure that in your transformations you're not doing funny things like getting the factors mixed up and all that you mean you'll be you'll be aware of that as well and yeah I don't know really it depends on the type of data that you're working with and I find it easier to create for example to create summary data frames and then feed those in rather than use the the stat equals whether it would be your account or you know something and I find it more intuitive I think the key really is that you have good visibility and what the transformations are and so that you're you're aware of what you're doing and and you can catch errors and things that are not going quite right and you I would recommend using things like test that to make sure that you've got and that you're sure the transformations are doing what they should be doing and but that's it gets harder and harder to do as your data gets larger and larger so definitely go and watch the workshop that's happening in parallel to this one about cleaning data because it'll be it'll be much more informative than than any answer that I could give I could give there and there was also a question from Matthew about about my background I covered it very quickly at the start but you didn't miss much and mostly to do with yeah so I grew up with a fascination for patterns in music and in language and had the privilege of doing a PhD in psychology to see something to do with how we process patterns and how we process things that we're not expecting to see in patterns in music and language and from there in psychology you do a lot of statistics and so went from there to a job in the postgraduate medical assessment world analysing exam data and and decided well discovered that I had a knack that I could develop for concisely explaining complex things to busy audiences you know surgeons are great and don't have that much time sometimes to spend on these things and it's really really good to be able to feed them in the information in a way that they understand it quickly and I found visualisation to be a really really great shortcut in that and that they could see the graph and they could remember it and that that made the explanation so much easier for what was going on in the data and then it was a series of circumstances of going on and telling to leave and wanting to keep my hand in and discovering the tidy Tuesday people and getting involved there and just growing and growing and my skills and as I was just really excited to see what could be done with art for data visualisation and then yeah went from there to to launching a consultancy and have really enjoyed the projects that I've been working on and just being able to bring these plotting solutions to people and be working in a whole host of different fields but the main thing for me is I get to make other people's work look good you know I get to I get to allow other people to shine with the expertise to get the reward that they deserve for the hard work that they've put in and that that to me is it's really rewarding. I hope that answers your question. Thanks Matthew. Thank you. I think people are gradually gradually disappearing if you're hanging in here and you have a question let me know what it is and well if there are no more questions I suggest we call it a day shout out now if you if you want if you have something else you want to ask or just get in touch in any of the channels that I've popped up on the screen there and yeah it's been it's been lovely sharing this workshop with you guys and thank you so much for all your contributions and your feedback in the chat it's been great and I hope to see you around in the future and in this conference as well. Enjoy the rest of your day and we will see you soon everyone and thanks again Martina.