Skip to content

Commit

Permalink
bugfix:matplotlib grid b=True option depricated, remove it from examples
Browse files Browse the repository at this point in the history
  • Loading branch information
armantekinalp committed May 12, 2023
1 parent 866d235 commit 81851f2
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 24 deletions.
8 changes: 4 additions & 4 deletions examples/BoundaryConditionsCases/bc_cases_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ def plot_position(
fig = plt.figure(figsize=(10, 10), frameon=True, dpi=150)
ax = fig.add_subplot(111)

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

fig.legend(prop={"size": 20})
Expand Down Expand Up @@ -65,8 +65,8 @@ def plot_video(
for time in range(1, len(time)):
fig.clf()
ax = plt.axes(projection="3d") # fig.add_subplot(111)
ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
ax.plot(
position_of_rod1[time, 0],
position_of_rod1[time, 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def plot_position(
fig = plt.figure(figsize=(10, 10), frameon=True, dpi=150)
ax = fig.add_subplot(111)

ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
ax.plot(position_of_rod1[:, 0, -1], position_of_rod1[:, 1, -1], "r-", label="rod1")
ax.plot(
position_of_rod2[:, 0, -1],
Expand Down Expand Up @@ -107,8 +107,8 @@ def plot_video(
for time in range(1, len(time)):
fig.clf()
ax = plt.axes(projection="3d") # fig.add_subplot(111)
ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
ax.plot(
position_of_rod1[time, 0],
position_of_rod1[time, 1],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ def plot_friction_validation(results, SAVE_FIGURE, filename):

fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
ax = fig.add_subplot(111)
# ax.grid(b=True, which="minor", color="k", linestyle="--")
# ax.grid(b=True, which="major", color="k", linestyle="-")
ax.plot(
sweep,
translational_energy,
Expand Down Expand Up @@ -71,8 +69,7 @@ def plot_axial_friction_validation(results, SAVE_FIGURE, filename):

fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
ax = fig.add_subplot(111)
# ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="major", color="k", linestyle="-")
ax.plot(
sweep,
translational_energy,
Expand Down
8 changes: 4 additions & 4 deletions examples/JointCases/joint_cases_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def plot_position(
fig = plt.figure(figsize=(10, 10), frameon=True, dpi=150)
ax = fig.add_subplot(111)

ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
ax.plot(position_of_rod1[:, 0, -1], position_of_rod1[:, 1, -1], "r-", label="rod1")
ax.plot(
position_of_rod2[:, 0, -1],
Expand Down Expand Up @@ -76,8 +76,8 @@ def plot_video(
for time in range(1, len(time)):
fig.clf()
ax = plt.axes(projection="3d") # fig.add_subplot(111)
ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
ax.plot(
position_of_rod1[time, 0],
position_of_rod1[time, 1],
Expand Down
4 changes: 2 additions & 2 deletions examples/MuscularSnake/post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ def plot_snake_velocity(

fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
ax = fig.add_subplot(111)
ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
ax.plot(
time_per_period[:], velocity_in_direction_of_rod[:, 0], "r-", label="forward"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def plot_video(

fig = plt.figure(1, figsize=(10, 8), frameon=True, dpi=dpi)
ax = plt.axes(projection="3d") # fig.add_subplot(111)
ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
# plt.axis("square")
i = 0
(rod_line,) = ax.plot(positions[i, 0], positions[i, 1], positions[i, 2], lw=3.0)
Expand Down
4 changes: 2 additions & 2 deletions examples/TimoshenkoBeamCase/timoshenko_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def analytical_unshearable(arg_rod, arg_end_force, n_elem=500):
def plot_timoshenko(rod, end_force, SAVE_FIGURE, ADD_UNSHEARABLE_ROD=False):
fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
ax = fig.add_subplot(111)
ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
analytical_shearable_positon = analytical_shearable(rod, end_force)
ax.plot(
analytical_shearable_positon[0],
Expand Down
4 changes: 2 additions & 2 deletions examples/convergence_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def plot_convergence(results, SAVE_FIGURE, filename):

fig = plt.figure(figsize=(10, 8), frameon=True, dpi=150)
ax = fig.add_subplot(111)
ax.grid(b=True, which="minor", color="k", linestyle="--")
ax.grid(b=True, which="major", color="k", linestyle="-")
ax.grid(which="minor", color="k", linestyle="--")
ax.grid(which="major", color="k", linestyle="-")
ax.loglog(
convergence_elements,
l1,
Expand Down

0 comments on commit 81851f2

Please sign in to comment.