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

font name/size not respected #229

Closed
parrt opened this issue Dec 30, 2022 · 6 comments
Closed

font name/size not respected #229

parrt opened this issue Dec 30, 2022 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@parrt
Copy link
Owner

parrt commented Dec 30, 2022

in trees.py, the label font size arguments are ignoring but we should also be specifying the font.

def regr_leaf_node(node, label_fontsize: int = 12): ...
def class_leaf_node(node, label_fontsize: int = 12): ...

It eventually calls the node_label() func:

<font face="Helvetica" ...>
@parrt parrt added the bug Something isn't working label Dec 30, 2022
@parrt
Copy link
Owner Author

parrt commented Dec 30, 2022

Well we are at it, we should look at this one. ticks_fontsize is ignored:

def _draw_barh_chart(counts, size, colors, filename, label=None, fontname="Arial", ticks_fontsize=9, graph_colors=None):

@mepland I think this one is a function you added so it might be fresh in your mind.

@mepland
Copy link
Collaborator

mepland commented Dec 31, 2022

Well we are at it, we should look at this one. ticks_fontsize is ignored:

def _draw_barh_chart(counts, size, colors, filename, label=None, fontname="Arial", ticks_fontsize=9, graph_colors=None):

@mepland I think this one is a function you added so it might be fresh in your mind.

_draw_barh_chart() doesn't actually draw any ticks currently, so we could probably just remove the ticks_fontsize=9 parameter in this case.

Relatedly, I would like to replace most of this block:

    ax.spines['left'].set_visible(False)
    ax.spines['right'].set_visible(False)
    ax.spines['top'].set_visible(False)
    ax.spines['bottom'].set_visible(False)
    ax.tick_params(axis='x', which='both', top=False, bottom=False, left=False, right=False)
    ax.get_yaxis().set_visible(False)

with that axis formatting util function I mentioned as point 2 here.

@mepland
Copy link
Collaborator

mepland commented Dec 31, 2022

It eventually calls the node_label() func:

<font face="Helvetica" ...>

@parrt let's try to merge #224 before messing with this code too much, to try and avoid merge issues.

@parrt
Copy link
Owner Author

parrt commented Dec 31, 2022

_draw_barh_chart() doesn't actually draw any ticks currently

I fixed that just now with 5cf1b61

@mepland
Copy link
Collaborator

mepland commented Jan 6, 2023

@parrt has this issue been fully addressed in dev now?

@parrt parrt added this to the 2.1 milestone Jan 6, 2023
@parrt
Copy link
Owner Author

parrt commented Jan 6, 2023

Looking at the code it seems all right but I can't remember exactly what example I was running. Let's close

@parrt parrt closed this as completed Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants