Subplot for seaborn boxplot

We create the figure with the subplots: f, axes = plt.subplots(1, 2) Where axes is an array with each subplot. Then we tell each plot in which subplot we want them with the argument ax. sns.boxplot( y=”b”, x= “a”, data=df, orient=”v” , ax=axes[0]) sns.boxplot( y=”c”, x= “a”, data=df, orient=”v” , ax=axes[1]) And the result is:

Seaborn load_dataset

load_dataset looks for online csv files on https://github.com/mwaskom/seaborn-data. Here’s the docstring: Load a dataset from the online repository (requires internet). Parameters name : str Name of the dataset (name.csv on https://github.com/mwaskom/seaborn-data). You can obtain list of available datasets using :func:get_dataset_names kws : dict, optional Passed to pandas.read_csv If you want to modify that online dataset … Read more

Plot multiple boxplot in one graph

You should get your data in a specific format by melting your data (see below for how melted data looks like) before you plot. Otherwise, what you have done seems to be okay. require(reshape2) df <- read.csv(“TestData.csv”, header=T) # melting by “Label”. `melt is from the reshape2 package. # do ?melt to see what other … Read more

matplotlib: Group boxplots

How about using colors to differentiate between “apples” and “oranges” and spacing to separate “A”, “B” and “C”? Something like this: from pylab import plot, show, savefig, xlim, figure, \ hold, ylim, legend, boxplot, setp, axes # function for setting the colors of the box plots pairs def setBoxColors(bp): setp(bp[‘boxes’][0], color=”blue”) setp(bp[‘caps’][0], color=”blue”) setp(bp[‘caps’][1], color=”blue”) … Read more