Do you ever feel like your subplots should be differently scaled? Fortunately, in matplotlib (and Seaborn, which is a derivative) it’s pretty easy to accomplish.
Simply use the plt.Figure() command to manually adjust the length and width of your figure. This will allow you to scale each subplot appropriately. The value of changing the relative dimensions of your subplots should be clear when using scatter plots, or any time series. All you need to do is plt.figure, and manually set the number of inches that you want each of the subplots to be. That said, it’s important to plan ahead on how you want to lay out the whole visualization, so that the data story to comes together as a cohesive whole.
Prototyping visualizations
I suggest prototyping your graph on a piece of paper with some dummy data, and getting a rough sense how many points you should expect in each subplot (and what the xlim and slim will be). That will give you guidance in how to set the size and scale of each of the sections of the matplotlib figure. And on a piece of paper, it often makes sense to go to a white Ford and try it out at a bigger size. The advantage is that people will naturally come around ask you what you’re doing, giving you a perfect user sample to make sure that the graph make sense. Too many people fall into the “curse of the expert” which means that they forget what someone who hasn’t been immersed in the analysis would not know. The most obvious example of this is forgetting to put labels on the X and Y axis, forgetting that other people have not thought of deeply about the visualization as you have. Additionally, well-written titles are critical for someone to be able to quickly grasp the take away message of any analysis (let alone a graphic refocused one).
Size denotes importance for many people, but don’t forget that you can also use color or position to draw the user’s eye to the right section of data at the right time!
Planning for varying aspect ratios
Printing is another consideration when you are designing the layout of your visualization. You may be in betting this into a webpage, or creating a PDF. Those are going to be two very different mediums – particularly if the webpage is designed to be viewed on mobile. It’s important to understand the aspect ratio that your users are likely to view the visualization with. For example, on a mobile phone the screen is much taller than it is wide. On a standard computer monitor, however, you are working with something that is wider than it is tall. Everything about your data story should match this. That includes the captions, the explanatory text, and of course the visualizations themselves.