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

make size of plots configurable #67

Closed
DJCordhose opened this issue Nov 26, 2019 · 7 comments
Closed

make size of plots configurable #67

DJCordhose opened this issue Nov 26, 2019 · 7 comments
Labels
enhancement New feature or request
Milestone

Comments

@DJCordhose
Copy link
Contributor

It would be great to have the sizes of plots configurable on all platforms even as SVGs. Same of the plots come out quite tiny and hard to read by default.

@parrt
Copy link
Owner

parrt commented Dec 4, 2019

Can we get away with a scale factor on entire SVG? I see lots of figsize specs for each node in tree (hardcoded). Not sure there's an easy way to change all matplotlib figsizes. And, do you mean in notebooks or when calling viz.view()? Where are they tiny? I've not seen that. Colab?

@parrt parrt added the enhancement New feature or request label Dec 4, 2019
@DJCordhose
Copy link
Contributor Author

Yes, in notebooks, e.g. on Colab, but also locally. Scaling factor would be great

@parrt
Copy link
Owner

parrt commented Dec 4, 2019

Hmm...I'm not sure how to scale the svg. I think this kinda thing might work:

from IPython.display import HTML
style = "<style>svg{width:50% !important;height:50% !important;}</style>"
HTML(style)

Nope. doesn't work.

Ok, crap. I think I know what to do. PAINFUL @DJCordhose but anything for you :)

@parrt parrt added this to the 0.8.1 milestone Dec 5, 2019
@parrt
Copy link
Owner

parrt commented Dec 5, 2019

Boom, Jack! scale parameter, but only on dtreeviz()

dtreeviz(regr,
       X_train,
       y_train,
       target_name='price',  # this name will be displayed at the leaf node
       feature_names=boston.feature_names,
       scale=(.8,.8)
      )

@parrt parrt closed this as completed in cb9150b Dec 5, 2019
@DJCordhose
Copy link
Contributor Author

DJCordhose commented Dec 5, 2019

This looks great, but nothing more than I expected :)

Did you already publish 0.8.1? still getting 0.8.0 when installing via pip

@moqri
Copy link

moqri commented Oct 20, 2022

It seems it is not working with 2 parameters scale:
TypeError: can't multiply sequence by non-int of type 'float'

@parrt
Copy link
Owner

parrt commented Oct 28, 2022

Hi. Are you using the latest version? You might try pip install -U dtreeviz just to make sure?

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

No branches or pull requests

3 participants