0

I would like to move the Y-Axis a bit higher and not intersect with the X-Axis.. This is how it currently looks..

enter image description here

This is how I want it to look like:

enter image description here

This is the code I have written for that.

fig = plt.figure()
ax = fig.add_subplot(111)
fig = matplotlib.pyplot.gcf()
fig.set_size_inches(6.0,3.0)

t = 100

kde = gaussian_kde(hurry)
dist_space_hurry = linspace( min(hurry), max(hurry), t )
ax.plot( dist_space_hurry, kde(dist_space_hurry), color='r', label='Hurry-up', linewidth=1.5)

kde_faban = gaussian_kde(faban_data)
faban_dist_space = linspace( min(faban_data), max(faban_data), t )
ax.plot( faban_dist_space, kde_faban(faban_dist_space) , color='g', label = 'Faban', linewidth=2)

ax.legend(loc='upper center', ncol=1, framealpha=0, bbox_to_anchor=(0.7, .95), fancybox=True)#, fontsize=8)
ax.xaxis.set_ticks_position('bottom')
ax.yaxis.set_ticks_position('left')
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
tandem
  • 2,040
  • 4
  • 25
  • 52
  • @RoryDaulton: The included graphic is what is happening right now.. The new graphic is how i want it to look like. – tandem Jun 21 '17 at 12:18
  • Your edit has made things more clear--good job. I don't know matplotlib well enough to answer your question, unfortunately. – Rory Daulton Jun 21 '17 at 12:25
  • @ImportanceOfBeingErnest Based on the look of the plots included in this question, it looks like tandem might be using version 1.5 or earlier. – saintsfan342000 Jun 21 '17 at 13:22
  • That is correct. i'm using 1.3.1. – tandem Jun 21 '17 at 13:46
  • You may want to consider upgrading, as that is a very old version. In the meantime, you can manually set the lower axis limit with `ax.axis(ymin=y)`, where `y` is the desired coordinate, which you can choose to be some value slightly less than zero. – saintsfan342000 Jun 21 '17 at 19:05

0 Answers0