<s> import numpy as np <EOL> from numpy . testing import dec <EOL> from statsmodels . graphics . boxplots import violinplot , beanplot <EOL> from statsmodels . datasets import anes96 <EOL> try : <EOL> import matplotlib . pyplot as plt <EOL> have_matplotlib = True <EOL> except : <EOL> have_matplotlib = False <EOL> @ dec . skipif ( not have_matplotlib ) <EOL> def test_violinplot_beanplot ( ) : <EOL> data = anes96 . load_pandas ( ) <EOL> party_ID = np . arange ( <NUM_LIT:7> ) <EOL> labels = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ] <EOL> age = [ data . exog [ '<STR_LIT>' ] [ data . endog == id ] for id in party_ID ] <EOL> fig = plt . figure ( ) <EOL> ax = fig . add_subplot ( <NUM_LIT> ) <EOL> violinplot ( age , ax = ax , labels = labels , <EOL> plot_opts = { '<STR_LIT>' : <NUM_LIT:5> , '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:30> } ) <EOL> plt . close ( fig ) <EOL> fig = plt . figure ( ) <EOL> ax = fig . add_subplot ( <NUM_LIT> ) <EOL> beanplot ( age , ax = ax , labels = labels , <EOL> plot_opts = { '<STR_LIT>' : <NUM_LIT:5> , '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT:30> } ) <EOL> plt . close ( fig ) </s>
