Skip to content

Commit

Permalink
Fix issue with fig.canvas.set_window_title on later matplotlib versions
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Jan 9, 2025
1 parent 0cb48ef commit cb8f51a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plot_positions.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def plot_muscle_activity(muscle_file_name, dt, logstep, save_figure=True, show_p
fig, ax0 = plt.subplots(4, sharex=True, sharey=True)

info = "Muscle activation values per quadrant"
fig.canvas.set_window_title(info)
fig.canvas.manager.set_window_title(info)

ax0[0].set_title('Muscle activation values per quadrant - '+quadrant0, size='small')
ax0[0].set_ylabel('muscle #')
Expand Down
8 changes: 4 additions & 4 deletions wcon/generate_wcon.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ def generate_wcon(pos_file_name,

plt.xlabel("x direction")
plt.ylabel("y direction")
fig.canvas.set_window_title(info)
fig.canvas.manager.set_window_title(info)
plt.title(info)

if save_figure1_to:
plt.savefig(save_figure1_to)

fig = plt.figure()
info = "Speed of worm in x (lateral) & y (along body) directions"
fig.canvas.set_window_title(info)
fig.canvas.manager.set_window_title(info)
plt.title(info)
plt.xlabel("Time (s)")
plt.ylabel("Speed")
Expand Down Expand Up @@ -274,7 +274,7 @@ def generate_wcon(pos_file_name,
ax = plt.gca();

info = "Propagation of curvature along body of worm (180=straight)"
fig.canvas.set_window_title(info)
fig.canvas.manager.set_window_title(info)
plt.title(info)

xt = ax.get_xticks()
Expand Down Expand Up @@ -372,7 +372,7 @@ def get_rainbow_color_for_volts(fract):
fig = plt.figure()
info = "Pos at %sms"%t
fig.canvas.set_window_title(info)
fig.canvas.manager.set_window_title(info)
plt.title(info)
mx = y[t]
Expand Down

0 comments on commit cb8f51a

Please sign in to comment.