In this post we will learn how to find all available style options for matplotlib plot themes and learn to set a style for matplotlib plot. To illustrate the styling options available in Matplotlib, we will use histogram made from beta distributions. To get started, let us load the modules needed. We can use style […]
How to create a list of plot objects and save them as files
In this post, we will learn a really nice trick on creating multiple ggplots from a dataframe and saving the plots into files using ggsave, using tidyverse purrr’s magic. We will use Purrr’s map function to create multiple plots from a dataframe and use another Purrr function pwalk to save the plots as files. Learned […]
On the effect of sample sizes on Sample Variance
Often we work with datasets of small sample sizes and rely on sample variances estimated from such datasets. One thing I have come across multiple times is that we lack the intuition/sense of how unreliable our sample variance estimates from data sets of small sample size can be. And I resort to a quick simulated […]
How to Select Columns/Rows by substring match in Pandas
In this post, we will learn how to select columns of a Pandas dataframe or a rows of a dataframe based on substring match in Pandas. We will use Pandas filter() function with argument “like” to select columns/rows, whose names partially match with a string of interest. Let us load the necessary modules. We are […]
How to write a simple custom ggplot theme from scratch
In this post, we will learn how to write your first custom ggplot2 theme and show how to use it to make the plots slightly easier/better. ggplot2 offers us great control to customize a plot. In earlier posts we saw how to use different theme elements, element_text(), element_line(), element_rect(), element_blank() to change to customize a […]