update colors to black mode
This commit is contained in:
19
lib/plots.py
19
lib/plots.py
@@ -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()
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 691 KiB After Width: | Height: | Size: 444 KiB |
Reference in New Issue
Block a user