0

I creating a simple frequency histogram:

figure(figsize=(12,9))

ax=subplot(111)
#Get rid of the border lines
ax.spines["top"].set_visible(False)
ax.spines["right"].set_visible(False)

#Axis label
xlabel("Gross Earnings", fontsize=16)  
ylabel("Frequency (in thousands)", fontsize=16) 

#Limit the x range so we can see the distribution more closely
xlim(0, 40000)

#Ticks
ax.get_xaxis().tick_bottom()
ax.get_yaxis().tick_left()

hist(earnings, weights=wgts, color="#3F5D7D", bins=100) 

I get the histogram alright, but I also get the giant arrays earnings and wgts in display. How do I get rid of those?

Thanks!

chungkim271
  • 927
  • 1
  • 10
  • 20

1 Answers1

0

You need to add ; to the end of your line with hist. This will suppress output in general, but in particular for graphing calls. (When graphing, ironically, the output is irrelevant; it is a side-effect of the call that shows the plot.)

Community
  • 1
  • 1
Ami Tavory
  • 74,578
  • 11
  • 141
  • 185