Hi everybody,
I'm trying to insert polar axes into another axis. I need to place many
windrose-like plots (bar plots in a polar axis) inside an xy plot. I need
them to move while panning the xy plot. To do so, I tried with inset_axes,
but I cannot force the new axis to be polar.
Or is there a better way to to it ?
Here is the code:
----
#!/usr/bin/python
import matplotlib.pyplot as plt
import numpy as np
import mpl_toolkits.axes_grid1.inset_locator as iloc
angleStart = 0.75
angleEnd = 2.5
ringOutterLimit = 0.95
ringWidth = 0.4
lineWidth = 1
values = np.array([0., 0.3, 0.95, 0.5, 0.1])
# Figure and main axis
fig = plt.figure(figsize=(5,5))
ax1 = fig.add_subplot(111)
ax1.plot([0,1], [0,1])
ax1.set_aspect(1.)
# Second axis
ax2 = iloc.inset_axes(ax1, width="100%", height="100%", loc=3,
bbox_to_anchor=(0.3, 0.5, 0.1, 0.1),
bbox_transform=ax1.transData)
bars = ax2.bar([np.pi/2., np.pi], [0.5, 0.2], width=.1*np.pi)
# Third axis
ax3 = iloc.inset_axes(ax1, width="100%", height="100%", loc=3,
bbox_to_anchor=(0.5, 0.7, 0.1, 0.1),
bbox_transform=ax1.transData)
bars = ax3.bar([np.pi/2., np.pi/4.], [0.1, 0.4], width=.1*np.pi)
plt.show()
----
Thanks a lot,
Pascal
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users