EMAworkbench icon indicating copy to clipboard operation
EMAworkbench copied to clipboard

Allow changing the figure size of a `parcoords.ParallelAxes()` plot

Open EwoutH opened this issue 2 years ago • 3 comments

Currently for a parcoords.ParallelAxes() you can change the number format, fontsize and label rotation, but not the figure size (or aspect ratio). If you have many variables this can be desirable.

A maybe even broader approach to this issue would be returning a matplotlib.pyplot.figure instead of a NoneType when calling ParallelAxes.plot(), for which you can change it's size and other aspects afterwards (with Figure.set_size_inches()).

EwoutH avatar Jun 07 '22 10:06 EwoutH

I agree, returning the figure is the obvious fix.

In the meantime, you can use plt.gcf() to get it.

quaquel avatar Jun 07 '22 10:06 quaquel

I was just checking the code. parcoords.ParallelAxes() is a class and fig is one of its attributes. So in principle, there is no need to have ParallelAxes.plot() return the figure because you already have it as an attribute on ParallelAxes.

If true, then this is more a matter of properly documenting the attributes of parcoords.ParallelAxes().

if instead, you want to maintain behavior similar to plt.plot(), you would have to return the Line2D instances rather than the figure.

quaquel avatar Jun 07 '22 15:06 quaquel

I still aim to do a deep dive into plotting at some point, but I don't think that will happen before the 2.3.0 release. I would suggest moving this to 2.4.0.

EwoutH avatar Oct 23 '22 20:10 EwoutH