Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] - missinval_plot method return ValueError #68

@alessandrofilisetti

Description

@alessandrofilisetti

Describe the bug
While trying to lot missing values I obtain the following error
ValueError: rotation must be 'vertical', 'horizontal' or a number, not 90

here the error backtrace

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In [24], line 1
----> 1 klib.missingval_plot(data_interim_df)

File ~/venv/lib/python3.10/site-packages/klib/describe.py:689, in missingval_plot(data, cmap, figsize, sort, spine_color)
    687 for rect, label in zip(ax1.patches, mv_cols):
    688     height = rect.get_height()
--> 689     ax1.text(
    690         rect.get_x() + rect.get_width() / 2,
    691         height + max(np.log(1 + height / 6), 0.075),
    692         label,
    693         ha="center",
    694         va="bottom",
    695         rotation="90",
    696         alpha=0.5,
    697         fontsize="11",
    698     )
    700 ax1.set_frame_on(True)
    701 for _, spine in ax1.spines.items():

File /shared-libs/python3.10/py/lib/python3.10/site-packages/matplotlib/axes/_axes.py:678, in Axes.text(self, x, y, s, fontdict, **kwargs)
    617 """
    618 Add text to the Axes.
    619 
   (...)
    668     >>> text(x, y, s, bbox=dict(facecolor='red', alpha=0.5))
    669 """
    670 effective_kwargs = {
    671     'verticalalignment': 'baseline',
    672     'horizontalalignment': 'left',
   (...)
    676     **kwargs,
    677 }
--> 678 t = mtext.Text(x, y, text=s, **effective_kwargs)
    679 t.set_clip_path(self.patch)
    680 self._add_text(t)

File /shared-libs/python3.10/py/lib/python3.10/site-packages/matplotlib/_api/deprecation.py:454, in make_keyword_only.<locals>.wrapper(*args, **kwargs)
    448 if len(args) > name_idx:
    449     warn_deprecated(
    450         since, message="Passing the %(name)s %(obj_type)s "
    451         "positionally is deprecated since Matplotlib %(since)s; the "
    452         "parameter will become keyword-only %(removal)s.",
    453         name=name, obj_type=f"parameter of {func.__name__}()")
--> 454 return func(*args, **kwargs)

File /shared-libs/python3.10/py/lib/python3.10/site-packages/matplotlib/text.py:178, in Text.__init__(self, x, y, text, color, verticalalignment, horizontalalignment, multialignment, fontproperties, rotation, linespacing, rotation_mode, usetex, wrap, transform_rotates_text, parse_math, **kwargs)
    176 self.set_horizontalalignment(horizontalalignment)
    177 self._multialignment = multialignment
--> 178 self.set_rotation(rotation)
    179 self._transform_rotates_text = transform_rotates_text
    180 self._bbox_patch = None  # a FancyBboxPatch instance

File /shared-libs/python3.10/py/lib/python3.10/site-packages/matplotlib/text.py:1197, in Text.set_rotation(self, s)
   1195     self._rotation = 90.
   1196 else:
-> 1197     raise ValueError("rotation must be 'vertical', 'horizontal' or "
   1198                      f"a number, not {s}")
   1199 self.stale = True

ValueError: rotation must be 'vertical', 'horizontal' or a number, not 90

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions