tfix line and axis colors - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 3df8979c87e405c0953c3f6fe2f931390a00f653
(DIR) parent 517744e5bea277a6912c9be2f1187a343881b9bc
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Mon, 19 Jan 2015 11:26:15 +0100
fix line and axis colors
Diffstat:
M python/sphere.py | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -5854,12 +5854,17 @@ class sim:
ax2 = ax1.twinx()
+ ax2color = '#666666'
if self.fluid:
- ax2.plot(time, self.phi_bar, 'r', label='Porosity')
+ ax2.plot(time, self.phi_bar, color=ax2color,
+ label='Porosity')
ax2.set_ylabel('Mean porosity $\\bar{\\phi}$ [-]')
else:
- ax2.plot(time, self.dilation, 'r', label='Dilation')
+ ax2.plot(time, self.dilation, color=ax2color,
+ label='Dilation')
ax2.set_ylabel('Dilation, $\Delta h/(2\\bar{r})$ [-]')
+ for tl in ax2.get_xticklabels():
+ tl.set_color(ax2color)
# Lower plot
ax3 = plt.subplot(2, 1, 2, sharex=ax1)
t@@ -5873,9 +5878,13 @@ class sim:
if self.fluid:
ax4 = ax3.twinx()
- ax4.plot(time, self.p_f_bar/1000.0, 'b', label='Pressure')
+ ax4color = '#666666'
+ ax4.plot(time, self.p_f_bar/1000.0, color=ax4color,
+ label='Pressure')
ax4.set_ylabel('Mean fluid pressure '
+ '$\\bar{p_\\text{f}}$ [kPa]')
+ for tl in ax4.get_xticklabels():
+ tl.set_color(ax4color)
# axis limits
ax3.set_ylim([self.w_tau_x/self.sigma_def[0]*0.5,
t@@ -5976,7 +5985,7 @@ class sim:
# Optional save of figure
if (outformat != 'txt'):
if savefig:
- filename = "{0}-{1}.{2}".format(self.sid, method, outformat))
+ filename = "{0}-{1}.{2}".format(self.sid, method, outformat)
fig.savefig(filename)
print(filename)
fig.clf()