0

I have spent a few hours browsing various tutorials, so I am asking after trying for a bit. I am also unable to get a simple arrow on the offset X and Y axes...

from mpl_toolkits.axes_grid.axislines import SubplotZero
from matplotlib import pylab
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
rcParams.update({'figure.autolayout': True})

ax = plt.subplot(111)

sigma = [-4, -2, 0]
jomega = [0, 0, 0]
plt.plot(sigma, jomega, 'x', mew=2, ms=12, linestyle='None')

plt.xlabel("amaranthus")
plt.ylabel('j$\omega')
plt.xlim(-8,2)
plt.ylim(-8,8)

ax.spines['right'].set_color('none')
ax.spines['left'].set_position(('data',0))
ax.spines['top'].set_color('none')
ax.spines['bottom'].set_position(('data',0))

plt.show()
Chris Maes
  • 35,025
  • 12
  • 111
  • 136
  • This can be harder than it seems. Check [this](http://stackoverflow.com/questions/4694478/center-origin-in-matplotlib) question and it's answer. Also a possible duplicate of the same. – Praveen Jan 11 '16 at 12:05
  • can you explain what problem you are having a bit more clearly? which labels are not showing up? What is your expected/desired output? – tmdavison Jan 11 '16 at 13:29

1 Answers1

0

Thanks all for your help.

I was unable to get the X and Y axis labels with the above code.

When I moved the label code towards the end of the program, just before plt.show(), they magically appeared.

For the moment, I am good, unless of course some of you can throw some immediate light on why this happens for the benefit of others...

Best, Rajesh.