Open jack89roberts opened 2 years ago
These functions also have a required class_column
argument:
pandas.plotting.andrews_curves
pandas.plotting.radviz
I'm not as familiar with those styles of plot but the same argument may apply (and making it optional for those should be similarly straightforward and not a breaking change).
There is no reason why parallel coordinate plots must be multi-class.
I would like to take this
Has this issue been resolved?
Is your feature request related to a problem?
Currently
class_column
is a required argument forpandas.plotting.parallel_coordinates
, which means a hack/workaround is needed to create a parallel coordinates plot for a single class (i.e. with a single colour).Describe the solution you'd like
class_column
should default toNone
, in which case a parallel coordinates plot with a single colour will be created.I've looked at the source code for the relevant function and I think it would be a fairly straightforward modification.
API breaking implications
I don't think this would cause any backwards-incompatible changes, the arguments to the function would stay the same and have the same order (only with
class_column
now being optional).It may be preferable to allow the
color
argument to take a single color value whenclass_column
isNone
(currentlycolor
is optional but expected to be a list of colors if defined).Describe alternatives you've considered
It's currently possible to hack a single-coloured parallel coordinates plot by creating a dummy
class_column
that has a constant value, e.g.What I'm proposing is for this to be possible instead:
Additional context
I found someone else asking a question about this in this issue: https://github.com/pandas-dev/pandas/issues/12341#issuecomment-299911662 . The response was along the lines of
class_column
being required because the general use-case for parallel coordinate plots is multivariate data. That may be true, but it's valid to want to create one for a single class and I don't think the API should force the plot to have a colour scale. Cases where creating a single class plot may be useful: