October 2018
Beginner to intermediate
676 pages
18h 30m
English
Let's take one more example of how to customize the size, length, and color of ticks. The following code block displays three plots; the first one uses default settings for ticks and ticklabels, and the second one is customized to display major and minor ticks, and the third one is customized to specify the length, thickness, and color of the major and minor ticks:
def Num_Format(x, pos): """The two arguments are the number and tick position""" if x >= 1e6: string = '${:1.1f}M'.format(x*1e-6) else: string = '${:1.0f}K'.format(x*1e-3) return string
def plot_graph(axes, axis, major_step_size, minor_step_size): majorLocator = MultipleLocator(major_step_size) ...
Read now
Unlock full access