#NEWLINE# @ cleanup #NEWLINE# def test_facet_grid( ) : #NEWLINE# #INDENT# _mask1 = ( ( diamonds . cut == 'Ideal' ) | ( diamonds . cut == 'Good' ) ) #NEWLINE# _mask2 = ( ( diamonds . clarity == 'SI2' ) | ( diamonds . clarity == 'VS1' ) ) #NEWLINE# _df = diamonds [ ( _mask1 & _mask2 ) ] #NEWLINE# p = ggplot ( aes ( x = 'x' , y = 'y' , colour = 'z' ) , data = _df ) #NEWLINE# p = ( ( p + geom_point ( ) ) + scale_colour_gradient ( low = 'white' , high = 'red' ) ) #NEWLINE# p = ( p + facet_grid ( 'cut' , 'clarity' ) ) #NEWLINE# assert_same_ggplot ( p , 'diamonds_big' ) #NEWLINE# p = ggplot ( aes ( x = 'carat' ) , data = _df ) #NEWLINE# p = ( ( p + geom_density ( ) ) + facet_grid ( 'cut' , 'clarity' ) ) #NEWLINE# assert_same_ggplot ( p , 'diamonds_facet' )