enthought / enthought/mayavi

Title and label Font size of color bar

Open
#643 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
316
Avg merge
7h 44m
Merged PRs (30d)
5

Description

When I try to change the font size of the title or text of a colorbar, nothing happens. For instance, in the following example:
`import numpy as np
from mayavi import mlab

x, y, z = np.ogrid[- .5:.5:200j, - .5:.5:200j, - .5:.5:200j]
r = np.sqrt(x ** 2 + y ** 2 + z ** 2)
L = - r ** 3 / 6 + 5. / 2 * r ** 2 - 10 * r + 6
Y = (x + y * 1j) ** 2 * z / r ** 3

Phi = L * Y * np.exp(- r) * r ** 2

mlab.figure(1, fgcolor=(1, 1, 1), bgcolor=(0, 0, 0))
src = mlab.pipeline.scalar_field(np.abs(Phi))
src.image_data.point_data.add_array(np.angle(Phi).T.ravel())
src.image_data.point_data.get_array(1).name = 'angle'
src.update()
src2 = mlab.pipeline.set_active_attribute(src,
point_scalars='scalar')
contour = mlab.pipeline.contour(src2)
contour2 = mlab.pipeline.set_active_attribute(contour,
point_scalars='angle')
mlab.pipeline.surface(contour2, colormap='hsv')

cb=mlab.colorbar(title='Phase', orientation='vertical', nb_labels=3)
cb.label_text_property.font_family = 'times'
cb.label_text_property.bold = 0
cb.label_text_property.font_size=24

mlab.show()

When Font_family and bold properties change, they affect the text in colorbar. However, this is not the case for the font size. Is it a bug or is there anything else that should be changed as well in order to change the font size in the colormap?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.