In Monte Carlo simulation, lattice field theory with a $theta$ term suffers from the sign problem. This problem can be circumvented by Fourier-transforming the topological charge distribution $P(Q)$. Although this strategy works well for small lattice volume, effect of errors of $P(Q)$ becomes serious with increasing volume and prevents one from studying the phase structure. This is called flattening. As an alternative approach, we apply the maximum entropy method (MEM) to the Gaussian $P(Q)$. It is found that the flattening could be much improved by use of the MEM.