Skip to content

Commit 814ca66

Browse files
author
ugurthemaster
committed
Update demo_floating_axes.py
1 parent 40b6020 commit 814ca66

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

examples/axes_grid/demo_floating_axes.py

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
# Import necessary libraries and modules
12
from matplotlib.transforms import Affine2D
2-
33
import mpl_toolkits.axisartist.floating_axes as floating_axes
4-
54
import numpy as np
65
import mpl_toolkits.axisartist.angle_helper as angle_helper
76
from matplotlib.projections import PolarAxes
87
from mpl_toolkits.axisartist.grid_finder import FixedLocator, MaxNLocator, \
98
DictFormatter
9+
import matplotlib.pyplot as plt
10+
1011

1112
def setup_axes1(fig, rect):
1213
"""
@@ -127,31 +128,28 @@ def setup_axes3(fig, rect):
127128

128129

129130

130-
if 1:
131-
import matplotlib.pyplot as plt
132-
fig = plt.figure(1, figsize=(8, 4))
133-
fig.subplots_adjust(wspace=0.3, left=0.05, right=0.95)
131+
##########################################################
132+
fig = plt.figure(1, figsize=(8, 4))
133+
fig.subplots_adjust(wspace=0.3, left=0.05, right=0.95)
134134

135-
ax1, aux_ax2 = setup_axes1(fig, 131)
136-
aux_ax2.bar([0, 1, 2, 3], [3, 2, 1, 3])
135+
ax1, aux_ax2 = setup_axes1(fig, 131)
136+
aux_ax2.bar([0, 1, 2, 3], [3, 2, 1, 3])
137137

138-
#theta = np.random.rand(10) #*.5*np.pi
139-
#radius = np.random.rand(10) #+1.
140-
#aux_ax1.scatter(theta, radius)
141-
142-
143-
ax2, aux_ax2 = setup_axes2(fig, 132)
138+
#theta = np.random.rand(10) #*.5*np.pi
139+
#radius = np.random.rand(10) #+1.
140+
#aux_ax1.scatter(theta, radius)
144141

145-
theta = np.random.rand(10)*.5*np.pi
146-
radius = np.random.rand(10)+1.
147-
aux_ax2.scatter(theta, radius)
142+
ax2, aux_ax2 = setup_axes2(fig, 132)
148143

144+
theta = np.random.rand(10)*.5*np.pi
145+
radius = np.random.rand(10)+1.
146+
aux_ax2.scatter(theta, radius)
149147

150-
ax3, aux_ax3 = setup_axes3(fig, 133)
148+
ax3, aux_ax3 = setup_axes3(fig, 133)
151149

152-
theta = (8 + np.random.rand(10)*(14-8))*15. # in degrees
153-
radius = np.random.rand(10)*14000.
154-
aux_ax3.scatter(theta, radius)
150+
theta = (8 + np.random.rand(10)*(14-8))*15. # in degrees
151+
radius = np.random.rand(10)*14000.
152+
aux_ax3.scatter(theta, radius)
155153

156-
plt.show()
154+
plt.show()
157155

0 commit comments

Comments
 (0)