<s> """<STR_LIT>""" <EOL> import matplotlib <EOL> import matplotlib . pyplot as plt <EOL> import numpy as np <EOL> from skimage import data , img_as_float <EOL> from skimage import exposure <EOL> matplotlib . rcParams [ '<STR_LIT>' ] = <NUM_LIT:8> <EOL> def plot_img_and_hist ( img , axes , bins = <NUM_LIT> ) : <EOL> """<STR_LIT>""" <EOL> img = img_as_float ( img ) <EOL> ax_img , ax_hist = axes <EOL> ax_cdf = ax_hist . twinx ( ) <EOL> ax_img . imshow ( img , cmap = plt . cm . gray ) <EOL> ax_img . set_axis_off ( ) <EOL> ax_hist . hist ( img . ravel ( ) , bins = bins , histtype = '<STR_LIT>' , color = '<STR_LIT>' ) <EOL> ax_hist . ticklabel_format ( axis = '<STR_LIT:y>' , style = '<STR_LIT>' , scilimits = ( <NUM_LIT:0> , <NUM_LIT:0> ) ) <EOL> ax_hist . set_xlabel ( '<STR_LIT>' ) <EOL> ax_hist . set_xlim ( <NUM_LIT:0> , <NUM_LIT:1> ) <EOL> ax_hist . set_yticks ( [ ] ) <EOL> img_cdf , bins = exposure . cumulative_distribution ( img , bins ) <EOL> ax_cdf . plot ( bins , img_cdf , '<STR_LIT:r>' ) <EOL> ax_cdf . set_yticks ( [ ] ) <EOL> return ax_img , ax_hist , ax_cdf <EOL> img = data . moon ( ) <EOL> gamma_corrected = exposure . adjust_gamma ( img , <NUM_LIT:2> ) <EOL> logarithmic_corrected = exposure . adjust_log ( img , <NUM_LIT:1> ) <EOL> fig = plt . figure ( figsize = ( <NUM_LIT:8> , <NUM_LIT:5> ) ) <EOL> axes = np . zeros ( ( <NUM_LIT:2> , <NUM_LIT:3> ) , dtype = np . object ) <EOL> axes [ <NUM_LIT:0> , <NUM_LIT:0> ] = plt . subplot ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , adjustable = '<STR_LIT>' ) <EOL> axes [ <NUM_LIT:0> , <NUM_LIT:1> ] = plt . subplot ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:2> , sharex = axes [ <NUM_LIT:0> , <NUM_LIT:0> ] , sharey = axes [ <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> adjustable = '<STR_LIT>' ) <EOL> axes [ <NUM_LIT:0> , <NUM_LIT:2> ] = plt . subplot ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:3> , sharex = axes [ <NUM_LIT:0> , <NUM_LIT:0> ] , sharey = axes [ <NUM_LIT:0> , <NUM_LIT:0> ] , <EOL> adjustable = '<STR_LIT>' ) <EOL> axes [ <NUM_LIT:1> , <NUM_LIT:0> ] = plt . subplot ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> ) <EOL> axes [ <NUM_LIT:1> , <NUM_LIT:1> ] = plt . subplot ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:5> ) <EOL> axes [ <NUM_LIT:1> , <NUM_LIT:2> ] = plt . subplot ( <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:6> ) <EOL> ax_img , ax_hist , ax_cdf = plot_img_and_hist ( img , axes [ : , <NUM_LIT:0> ] ) <EOL> ax_img . set_title ( '<STR_LIT>' ) <EOL> y_min , y_max = ax_hist . get_ylim ( ) <EOL> ax_hist . set_ylabel ( '<STR_LIT>' ) <EOL> ax_hist . set_yticks ( np . linspace ( <NUM_LIT:0> , y_max , <NUM_LIT:5> ) ) <EOL> ax_img , ax_hist , ax_cdf = plot_img_and_hist ( gamma_corrected , axes [ : , <NUM_LIT:1> ] ) <EOL> ax_img . set_title ( '<STR_LIT>' ) <EOL> ax_img , ax_hist , ax_cdf = plot_img_and_hist ( logarithmic_corrected , axes [ : , <NUM_LIT:2> ] ) <EOL> ax_img . set_title ( '<STR_LIT>' ) <EOL> ax_cdf . set_ylabel ( '<STR_LIT>' ) <EOL> ax_cdf . set_yticks ( np . linspace ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:5> ) ) <EOL> fig . tight_layout ( ) <EOL> plt . show ( ) </s>
