Search code examples
pythonyellowbrick

How to set figure size in yellowbrick plots?


So I've just recently started to discover the power of yellowbrick library (thanks!) but is there a way I could set a figure size for the inline plots?


Solution

  • thanks for giving Yellowbrick (scikit-yb.org) a try! Be sure to follow us on Twitter @scikit-yb and star us on GitHib (https://github.com/DistrictDataLabs/yellowbrick).

    To address your question (which is addressed along with other plot customization and other questions in our FAQs in the docs: https://www.scikit-yb.org/en/latest/faq.html): You can change the size of a plot by passing in the desired dimensions in pixels on instantiation of the visualizer (note the below is an example for RadViz but the size param works across Yellowbrick):

    Import the visualizer

    from yellowbrick.features import RadViz
    

    Instantiate the visualizer using the size param

    visualizer = RadViz(
        classes=classes, features=features, size=(1080, 720))
    

    Thanks for the question, check out our docs, work through the tutorials in the docs and go forth and conquer! Stay in touch with us on Twitter! Thanks, Team Yellowbrick