-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add LineCollection plot #7173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add LineCollection plot #7173
Conversation
|
Scatter vs. Lines: ds = xr.tutorial.scatter_example_dataset(seed=42)
hue_ = "y"
x_ = "y"
size_="y"
z_ = "z"
fig = plt.figure()
ax = fig.add_subplot(1, 2, 1, projection='3d')
ds.A.sel(w="one").plot.lines(x=x_, z=z_, hue=hue_, linewidth=size_, ax=ax)
ax = fig.add_subplot(1, 2, 2, projection='3d')
ds.A.sel(w="one").plot.scatter(x=x_, z=z_, hue=hue_, markersize=size_, ax=ax) |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…to plot1d_lines
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
line_collection implies a more basic version in my mind:
Seaborns new object-based plotting uses |
for more information, see https://pre-commit.ci
…to plot1d_lines
for more information, see https://pre-commit.ci
…to plot1d_lines
for more information, see https://pre-commit.ci

This adds a line plotter based on
LineCollections, called.lines.I wanted to replace
darray.plot()with using LineCollection instead. But unfortunately due to how many cases are supported (and tested in xarray)darray.plot()will continue usingplt.plot.Examples:
Got this working with xarray:
Calling it lines since scatter is not called path_collection:
Seaborns new object-based plotting uses
linesas well with similar argument:https://seaborn.pydata.org/generated/seaborn.objects.Line.html
https://seaborn.pydata.org/generated/seaborn.objects.Lines.html
xref:
#4820
#5622