1
0

update colors to black mode

This commit is contained in:
Thibault Barnouin
2021-11-11 14:44:32 +01:00
parent 6e72c165b9
commit 966b6493ac
2 changed files with 16 additions and 3 deletions

View File

@@ -24,8 +24,21 @@ class DynamicUpdate():
def on_launch(self):
#Set up plot
self.fig = plt.figure(figsize=(10,10))
self.fig = plt.figure(figsize=(10,10), facecolor='k')
self.ax = self.fig.add_subplot(projection='3d')
self.ax.set_facecolor('k')
self.ax.xaxis.label.set_color('w')
self.ax.yaxis.label.set_color('w')
self.ax.zaxis.label.set_color('w')
self.ax.tick_params(axis='x',colors='w')
self.ax.tick_params(axis='y',colors='w')
self.ax.tick_params(axis='z',colors='w')
self.ax.w_xaxis.line.set_color('w')
self.ax.w_yaxis.line.set_color('w')
self.ax.w_zaxis.line.set_color('w')
self.ax.w_xaxis.set_pane_color((0,0,0,0))
self.ax.w_yaxis.set_pane_color((0,0,0,0))
self.ax.w_zaxis.set_pane_color((0,0,0,0))
self.lines = []
for i,body in enumerate(self.dyn_syst.bodylist):
x, y, z = body.q
@@ -37,7 +50,7 @@ class DynamicUpdate():
self.set_lims()
#Other stuff
self.ax.grid()
self.ax.legend()
self.ax.legend(labelcolor='w', frameon=True, framealpha=0.2)
def on_running(self, dyn_syst, step=None, label=None):
xdata, ydata, zdata = dyn_syst.get_positions()
@@ -49,7 +62,7 @@ class DynamicUpdate():
x, y, z = body.q
self.lines[i].set_data_3d([x], [y], [z])
if not label is None:
self.ax.set_title(label)
self.ax.set_title(label,color='w')
#Need both of these in order to rescale
self.ax.relim()
self.ax.autoscale_view()