user3645594
user3645594

Reputation: 121

Setting the color of mayavi.mlab.mesh axes labels

I am trying to set the color of the axes labels in a plot generated using mayavi.mlab.mesh to white using the following extract of code:

ax = m.axes(color=(1.0,1.0,1.0),nb_labels=4, xlabel='Delay (ps)', ylabel='Wavelength (nm)', x_axis_visibility=True, y_axis_visibility=True, z_axis_visibility=False, ranges=[tdelays.min(), tdelays.max(), wls.min(), wls.max(), 0, 1], figure=f)
ax.axes.font_factor = 1.3
ax.axes.label_format = '    %4.0f'
ax.label_text_property.bold = False
ax.label_text_property.italic = False
ax.label_text_property.color = (1.0, 1.0, 1.0)
ax.property.color = (1.0, 1.0, 1.0) 

Unfortunately, the above only changes the axes line color and axes tick color to white. The axes labels stay in black (presumably set by default).

Is there a handle to the color of the axes labels in Mayavi?

Thanks.

Upvotes: 5

Views: 2746

Answers (1)

Warren Lamont
Warren Lamont

Reputation: 185

For mayavi scenes I typically set the background and foreground colors at the onset. For example:

mlab.figure(bgcolor=(1,1,1), fgcolor=(0.,0.,0.))

will provide a white background and black for all foreground colors including the axes labels will be black.

Upvotes: 5

Related Questions