endangeredoxen / fivecentplots

A Python plotting analgesic
https://endangeredoxen.github.io/fivecentplots
11 stars 6 forks source link

FCP version 0.4.3 | 'Line2D' object has no attribute '_legmarker' error #40

Closed hgaonkar closed 2 years ago

hgaonkar commented 2 years ago

python version 3.9.11 fcp version 0.4.3 Command used : fcp.plot(image_loc_df, x='EIT [ms]', y='AG', legend='DG')

AG, DG, and EIT [ms] are all float64 . Works fine without legend option.

Error: Unexpected exception formatting exception. Falling back to standard exception Traceback (most recent call last): File "C:\Users\TEIV-1\miniconda3\envs\imagecrunch\lib\site-packages\IPython\core\interactiveshell.py", line 3369, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "C:\Users\TEIV-1\AppData\Local\Temp\ipykernel_15820\742559488.py", line 1, in <cell line: 1> fcp.plot(image_loc_df, x='EIT [ms]', y='AG', legend='DG') File "C:\Users\TEIV-1\miniconda3\envs\imagecrunch\lib\site-packages\fivecentplots\fcp.py", line 233, in plot return plotter('plot_xy', dfkwarg(args, kwargs)) File "C:\Users\TEIV-1\miniconda3\envs\imagecrunch\lib\site-packages\fivecentplots\fcp.py", line 735, in plotter dd = layout.make_figure(dd, kwargs) File "C:\Users\TEIV-1\miniconda3\envs\imagecrunch\lib\site-packages\fivecentplots\engines\mpl.py", line 1619, in make_figure data = self.get_element_sizes(data) File "C:\Users\TEIV-1\miniconda3\envs\imagecrunch\lib\site-packages\fivecentplots\engines\mpl.py", line 1042, in get_element_sizes leg.legendHandles[irow]._legmarker\ AttributeError: 'Line2D' object has no attribute '_legmarker'

endangeredoxen commented 2 years ago

What version of matplotlib are you using?

hgaonkar commented 2 years ago

matplotlib version 3.5.1

hgaonkar commented 2 years ago

A fresh install of python solves this issue.

hgaonkar commented 2 years ago

Unfortunately, this is a recurring error. On a more recent fresh python install, I received this error. Maybe something to do with installation using miniconda vs anaconda. Not sure. Either way, I updated to 0.5.0 and error goes away.

endangeredoxen commented 2 years ago

I'm focused on getting 0.5.0 ready for alpha release so I can't debug this right now. I suspect it comes from you using a newer version of MPL that was never tested with fcp 0.4.3. Will revisit this later

endangeredoxen commented 2 years ago

Fixed this for v0.5.0