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

Added label options to plot method #360

Open
wants to merge 1 commit into
base: 2.0.0b5
Choose a base branch
from

Conversation

smartbackwards
Copy link

Added label_direction and label_fontsize as optional parameters in the point_settings dictionary, in the plot method.

label_fontsize specifies the size of the font for the label of a given point (defaults to 6, old hard coded parameter)

label_direction specifies the location of the label in relation to the dot. Defaults to 0 - above the point. 90 would place the label to the right of the point, 180 below, 270 directly to the left etc.

Please note two things:

  • i hardcoded the label_horizontal_offset value. The alternative was to create another pyplot figure, plotting the label there and getting the length from text_object.get_window_extent(renderer=renderer). That seemed like it would slow down the time of execution too much. The hardcoded value works best for labels of length 5-10.
  • Aesthetically it made more sense for me for the label to be on top of the HP/armor bars, instead of enlarging/adjusting the position of the ellipse on which the label is plotted. see pics below:

image
image

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

Successfully merging this pull request may close these issues.

1 participant