Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ax.grid(kind='polar') not working #16

Open
MWack opened this issue Jan 27, 2017 · 2 comments
Open

ax.grid(kind='polar') not working #16

MWack opened this issue Jan 27, 2017 · 2 comments

Comments

@MWack
Copy link

MWack commented Jan 27, 2017

Using anaconada with pyton 3 on Linux. Installed mplstereonet 0.5 with pip. Can't get a polar overlay.

import matplotlib.pyplot as plt
import mplstereonet
fig = plt.figure()
ax = fig.add_subplot(111, projection='stereonet')
ax.grid(kind='polar')
fig.show()


AttributeError Traceback (most recent call last)
in ()
4 fig = plt.figure()
5 ax = fig.add_subplot(111, projection='stereonet')
----> 6 ax.grid(kind='polar')
7 fig.show()

/home/wack/bin/anaconda3/lib/python3.4/site-packages/matplotlib/axes/_base.py in grid(self, b, which, axis, **kwargs)
2424
2425 if axis == 'x' or axis == 'both':
-> 2426 self.xaxis.grid(b, which=which, **kwargs)
2427 if axis == 'y' or axis == 'both':
2428 self.yaxis.grid(b, which=which, **kwargs)

/home/wack/bin/anaconda3/lib/python3.4/site-packages/matplotlib/axis.py in grid(self, b, which, **kwargs)
1370 tick.gridOn = self._gridOnMajor
1371 if len(kwargs):
-> 1372 tick.gridline.update(kwargs)
1373 self._major_tick_kw['gridOn'] = self._gridOnMajor
1374 self.stale = True

/home/wack/bin/anaconda3/lib/python3.4/site-packages/matplotlib/artist.py in update(self, props)
854 func = getattr(self, 'set_' + k, None)
855 if func is None or not six.callable(func):
--> 856 raise AttributeError('Unknown property %s' % k)
857 func(v)
858 changed = True

AttributeError: Unknown property kind

@joferkington
Copy link
Owner

Polar grids are only supported in the development version, at the moment. I haven't put out a release of mplstereonet since last summer, so v0.5 is a bit behind.

I should probably try to get a release out fairly soon. I haven't had much time to maintain these projects lately, though. My apologies for that. In the meantime, you can install the current development version with pip install https://github.com/joferkington/mplstereonet/zipball/master.

@stims99
Copy link

stims99 commented Jul 12, 2023

For anyone else with this issue you can plot the polar plot using matplotlib inputs:

ax.grid(kind = 'polar', alpha = 0.5) 
ax.set_longitude_grid_ends(80)
plt.xticks(np.arange(-2*np.pi,2*np.pi,np.pi/18))
plt.yticks(np.arange(0,100*np.pi/180,10*np.pi/180))    
ax._polar.set_position(ax.get_position())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants