Skip to content
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

line3D set_data only takes in x and y data #8914

Closed
fragapanagos opened this issue Jul 19, 2017 · 3 comments · Fixed by #10111
Closed

line3D set_data only takes in x and y data #8914

fragapanagos opened this issue Jul 19, 2017 · 3 comments · Fixed by #10111
Labels
Good first issue Open a pull request against these issues if there are no active ones! topic: mplot3d
Milestone

Comments

@fragapanagos
Copy link

Bug report

I was attempting to make an interactive 3D line plot in jupyter notebook, but noticed that line3D set_data method only takes in x and y data.

Code for reproduction
The code below can be run outside of jupyter notebook to demonstrate the problem:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
x = [0, 1]
y = [0, 1]
z = [0, 1]
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
line = ax.plot(x,y,z)[0]
line.set_data([0,2], [0,2], [0,2])
plt.show()

Actual outcome

ValueError: too many values to unpack (expected 2)

Expected outcome

I would expect the set_data method exposed by line3D to take in 3 values.

Matplotlib version

  • Matplotlib Version: 2.0.0
  • Python Version: 3.6.0
@tacaswell
Copy link
Member

I suspect you want to do this with the current set_data + set_3d_properties methods.

Exact work:

  • The set_data method needs to be over-ridden in mpl_toolkits.mplot3D.art3D.Line3D
  • add a test (does not raise should be enough)
  • bonus: also do get_data

@WeatherGod
Copy link
Member

WeatherGod commented Jul 20, 2017 via email

@eeshugerman
Copy link

eeshugerman commented Jul 23, 2017

@WeatherGod

You can't override set/get_data. Those methods are widely used throughout the codebase and elsewhere, and it is understood to mean the data as displayed in the 2d coordinates. This is why we really need a new set/get data method

In the meantime, should a set_data_3d method be added to mpl_toolkits.mplot3D.art3D.Line3D? I'm new, looking for something to get started with.

@tacaswell tacaswell added the Good first issue Open a pull request against these issues if there are no active ones! label Oct 16, 2017
@QuLogic QuLogic modified the milestones: unassigned, v3.1 Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good first issue Open a pull request against these issues if there are no active ones! topic: mplot3d
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants