Skip to content

Commit 81851f2

Browse files
committed
bugfix:matplotlib grid b=True option depricated, remove it from examples
1 parent 866d235 commit 81851f2

File tree

8 files changed

+21
-24
lines changed

8 files changed

+21
-24
lines changed

examples/BoundaryConditionsCases/bc_cases_postprocessing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def plot_position(
1313
fig = plt.figure(figsize=(10, 10), frameon=True, dpi=150)
1414
ax = fig.add_subplot(111)
1515

16-
ax.grid(b=True, which="minor", color="k", linestyle="--")
17-
ax.grid(b=True, which="major", color="k", linestyle="-")
16+
ax.grid(which="minor", color="k", linestyle="--")
17+
ax.grid(which="major", color="k", linestyle="-")
1818
ax.plot(position_of_rod1[:, 0, -1], position_of_rod1[:, 1, -1], "r-", label="rod1")
1919

2020
fig.legend(prop={"size": 20})
@@ -65,8 +65,8 @@ def plot_video(
6565
for time in range(1, len(time)):
6666
fig.clf()
6767
ax = plt.axes(projection="3d") # fig.add_subplot(111)
68-
ax.grid(b=True, which="minor", color="k", linestyle="--")
69-
ax.grid(b=True, which="major", color="k", linestyle="-")
68+
ax.grid(which="minor", color="k", linestyle="--")
69+
ax.grid(which="major", color="k", linestyle="-")
7070
ax.plot(
7171
position_of_rod1[time, 0],
7272
position_of_rod1[time, 1],

examples/ExperimentalCases/GenericSystemConnectionCases/joint_cases_postprocessing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def plot_position(
2525
fig = plt.figure(figsize=(10, 10), frameon=True, dpi=150)
2626
ax = fig.add_subplot(111)
2727

28-
ax.grid(b=True, which="minor", color="k", linestyle="--")
29-
ax.grid(b=True, which="major", color="k", linestyle="-")
28+
ax.grid(which="minor", color="k", linestyle="--")
29+
ax.grid(which="major", color="k", linestyle="-")
3030
ax.plot(position_of_rod1[:, 0, -1], position_of_rod1[:, 1, -1], "r-", label="rod1")
3131
ax.plot(
3232
position_of_rod2[:, 0, -1],
@@ -107,8 +107,8 @@ def plot_video(
107107
for time in range(1, len(time)):
108108
fig.clf()
109109
ax = plt.axes(projection="3d") # fig.add_subplot(111)
110-
ax.grid(b=True, which="minor", color="k", linestyle="--")
111-
ax.grid(b=True, which="major", color="k", linestyle="-")
110+
ax.grid(which="minor", color="k", linestyle="--")
111+
ax.grid(which="major", color="k", linestyle="-")
112112
ax.plot(
113113
position_of_rod1[time, 0],
114114
position_of_rod1[time, 1],

examples/FrictionValidationCases/friction_validation_postprocessing.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ def plot_friction_validation(results, SAVE_FIGURE, filename):
2121

2222
fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
2323
ax = fig.add_subplot(111)
24-
# ax.grid(b=True, which="minor", color="k", linestyle="--")
25-
# ax.grid(b=True, which="major", color="k", linestyle="-")
2624
ax.plot(
2725
sweep,
2826
translational_energy,
@@ -71,8 +69,7 @@ def plot_axial_friction_validation(results, SAVE_FIGURE, filename):
7169

7270
fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
7371
ax = fig.add_subplot(111)
74-
# ax.grid(b=True, which="minor", color="k", linestyle="--")
75-
ax.grid(b=True, which="major", color="k", linestyle="-")
72+
ax.grid(which="major", color="k", linestyle="-")
7673
ax.plot(
7774
sweep,
7875
translational_energy,

examples/JointCases/joint_cases_postprocessing.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def plot_position(
1717
fig = plt.figure(figsize=(10, 10), frameon=True, dpi=150)
1818
ax = fig.add_subplot(111)
1919

20-
ax.grid(b=True, which="minor", color="k", linestyle="--")
21-
ax.grid(b=True, which="major", color="k", linestyle="-")
20+
ax.grid(which="minor", color="k", linestyle="--")
21+
ax.grid(which="major", color="k", linestyle="-")
2222
ax.plot(position_of_rod1[:, 0, -1], position_of_rod1[:, 1, -1], "r-", label="rod1")
2323
ax.plot(
2424
position_of_rod2[:, 0, -1],
@@ -76,8 +76,8 @@ def plot_video(
7676
for time in range(1, len(time)):
7777
fig.clf()
7878
ax = plt.axes(projection="3d") # fig.add_subplot(111)
79-
ax.grid(b=True, which="minor", color="k", linestyle="--")
80-
ax.grid(b=True, which="major", color="k", linestyle="-")
79+
ax.grid(which="minor", color="k", linestyle="--")
80+
ax.grid(which="major", color="k", linestyle="-")
8181
ax.plot(
8282
position_of_rod1[time, 0],
8383
position_of_rod1[time, 1],

examples/MuscularSnake/post_processing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ def plot_snake_velocity(
454454

455455
fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
456456
ax = fig.add_subplot(111)
457-
ax.grid(b=True, which="minor", color="k", linestyle="--")
458-
ax.grid(b=True, which="major", color="k", linestyle="-")
457+
ax.grid(which="minor", color="k", linestyle="--")
458+
ax.grid(which="major", color="k", linestyle="-")
459459
ax.plot(
460460
time_per_period[:], velocity_in_direction_of_rod[:, 0], "r-", label="forward"
461461
)

examples/RigidBodyCases/RodRigidBodyContact/post_processing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def plot_video(
5858

5959
fig = plt.figure(1, figsize=(10, 8), frameon=True, dpi=dpi)
6060
ax = plt.axes(projection="3d") # fig.add_subplot(111)
61-
ax.grid(b=True, which="minor", color="k", linestyle="--")
62-
ax.grid(b=True, which="major", color="k", linestyle="-")
61+
ax.grid(which="minor", color="k", linestyle="--")
62+
ax.grid(which="major", color="k", linestyle="-")
6363
# plt.axis("square")
6464
i = 0
6565
(rod_line,) = ax.plot(positions[i, 0], positions[i, 1], positions[i, 2], lw=3.0)

examples/TimoshenkoBeamCase/timoshenko_postprocessing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def analytical_unshearable(arg_rod, arg_end_force, n_elem=500):
4949
def plot_timoshenko(rod, end_force, SAVE_FIGURE, ADD_UNSHEARABLE_ROD=False):
5050
fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
5151
ax = fig.add_subplot(111)
52-
ax.grid(b=True, which="minor", color="k", linestyle="--")
53-
ax.grid(b=True, which="major", color="k", linestyle="-")
52+
ax.grid(which="minor", color="k", linestyle="--")
53+
ax.grid(which="major", color="k", linestyle="-")
5454
analytical_shearable_positon = analytical_shearable(rod, end_force)
5555
ax.plot(
5656
analytical_shearable_positon[0],

examples/convergence_functions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def plot_convergence(results, SAVE_FIGURE, filename):
3030

3131
fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
3232
ax = fig.add_subplot(111)
33-
ax.grid(b=True, which="minor", color="k", linestyle="--")
34-
ax.grid(b=True, which="major", color="k", linestyle="-")
33+
ax.grid(which="minor", color="k", linestyle="--")
34+
ax.grid(which="major", color="k", linestyle="-")
3535
ax.loglog(
3636
convergence_elements,
3737
l1,

0 commit comments

Comments
 (0)