Medical Data Visualizer - Heatmaps and/or issues with the test module?

Tell us what’s happening:

I have 2 main questions:

  1. When I run the test code, I am getting back 2 errors. However, looking at the tracebacks, this is talking about issues in the test_module… not my code. Did I do something wrong here?

  2. If you run my code, my bar charts look great, but I cannot quite get my heatmaps customized how I want (the color grading is different, the font is still a little too large, the column is out of scale…). All of this is in comparison to the test photo of course, but any advice on how to further refine this image? I have gone through all of the parameters in the documentation

Your code so far

Challenge Information:

Data Analysis with Python Projects - Medical Data Visualizer

The tests are expecting things in a certain format. Check out this error here: https://forum.freecodecamp.org/t/problem-with-medical-data-visualiser/460315/3

1 Like

Adding fig = fig.figure before saving the catplot would also work: https://forum.freecodecamp.org/t/data-analysis-with-python-projects-medical-data-visualizer/648627

1 Like

Sorry this took so long to get back to – I was gone traveling.
Thanks so much for that! Would you mind explaining why this is necessary / works?
I see in the comment of that thread that it converts the seaborn facet grid into a figure that the tests can read… would this be necessary in most tests, or is this primarily only in the context of this project?

I think it’s only necessary for these tests. The chart still generates and that’s the result you would be looking for if you were analyzing data.

There could be some real situation where you would need to access something in the underlying figure and need to do this, I’m not sure. If it does come up now you’ve at least encountered this once!