Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I control the scientific notation that appears as labels on the bars? #17

Open
VincentLa14 opened this issue Jun 20, 2017 · 1 comment

Comments

@VincentLa14
Copy link

No description provided.

@popher
Copy link

popher commented Oct 27, 2017

The 'hack' solution is to edit visualisation.py (in the package).

Edit lines 382 and 385, changing the "%.2g" to a "%.0f" (line 382) and style='sci' to 'plain', and comment out everything after 'y' (line 385).

381 for x, y in zip(self.x_values, inters_sizes):
382 ax.text(x, y + label_vertical_gap, "%.0f" % y,
383 rotation=90, ha='center', va='bottom',size=14)

385 ax.ticklabel_format(style='plain', axis='y')#, scilimits=(0, 4))

This will force it to present the vertical bar plot labels as integers. Repeat the second part on 297 if you want to format the "Set Size" part (lower left corner of figure).

I think there will be a way to do it without editing the package, by getting the figure object and changing the tick formatter, but I struggled with that.

Best solution would be a kwarg the user could pass to define if they want scientific or not at the first stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants