Issue 1:
Bug report

Bug summary

Histogram missing in Matplotlib 2.1.0. See the following figures, one is from 2.1.0 and the other is from 2.0.2.

Code for reproduction

This code is exactly the same code we are using except the data is changed to random one. I suppose it will be minimal enough?

#!/usr/bin/env python3

import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import collections

def plot_figure(distribution):
percentile = [95, 99]
percentile_color = 'yg'
mean_color = 'c'
bins = 100

legend_handle = []
legend_title = []

fig, (ax0, ax1) = plt.subplots(2, sharex=True)
fig.subplots_adjust(hspace=0)
mu, sigma = 100, 15
xs_downstream = mu + sigma*np.random.randn(10000)
xs_upstream = mu + sigma*np.random.randn(10000)
xmin = min(np.min(xs_downstream), np.min(xs_upstream))
xmax = max(np.max(xs_downstream), np.max(xs_upstream))

hist0 = ax0.hist(xs_downstream, bins=bins, range=(xmin, xmax), color='red', label='{} workload with Proxy'.format(distribution.capitalize()))
handles, labels = ax0.get_legend_handles_labels()
line = ax0.axvline(x=np.mean(xs_downstream), color=mean_color, linewidth=1)
legend_title.append('Mean')
legend_handle.append(line)

for percent, color in zip(percentile, percentile_color):
line = ax0.axvline(x=xs_downstream[int(percent / 100 * len(xs_downstream))], color=color, linewidth=1)
legend_title.append('{}th percentile'.format(percent))
legend_handle.append(line)

ax0.set_yscale('log')
legend_title += labels
legend_handle += handles

hist1 = ax1.hist(xs_upstream, bins=bins, range=(xmin, xmax), color='blue', label='{} workload without Proxy'.format(distribution.capitalize()))
handles, labels = ax1.get_legend_handles_labels()
legend_title += labels
legend_handle += handles
ax1.axvline(x=np.mean(xs_upstream), color=mean_color, linewidth=1)

for percent, color in zip(percentile, percentile_color):
ax1.axvline(x=xs_upstream[int(percent / 100 * len(xs_upstream))], color=color, linewidth=1)

ax1.set_yscale('log')
ax0.legend(legend_handle, legend_title)
ax1.set_xlabel('latency (ms)')

fig.savefig('latency-{}.pdf'.format(distribution))

def main():
plot_figure('zipf')
plot_figure('uniform')

if __name__ == '__main__':
main()

Actual outcome

Expected outcome

Works well in 2.0.2.

Matplotlib version

Operating system: Both macOS High Sierra and Ubuntu 17.10

Matplotlib version: 2.1.0

Matplotlib backend (print(matplotlib.get_backend())): MacOSX

Python version: 3.6.3

Jupyter version (if applicable):

Other libraries:

Installed using pip3

Thanks!

Issue 2:
Bug report

Bug summary

Setting a logarithmic y-axis with ax.set_yscale('log') causes histograms to disappear from the axis. This occurs in 2.1.0 but not in 2.0.2.

Code for reproduction

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np

xs = np.random.normal(size=int(1e6))
fig, (ax1, ax2) = plt.subplots(1, 2)
ax1.hist(xs, range=(-5, 5), bins=100)
ax2.hist(xs, range=(-5, 5), bins=100)
ax2.set_ylim(ymin=1)
ax2.set_yscale('log')
fig.savefig('histogram.png')

Actual outcome

With 2.1.0:

Expected outcome

I expect to see a logarithm y-axis and the histogram, but I only see the former. With 2.0.2 I see this: