GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Lists not supported by Axes3D.plot_surface · Issue #181 · matplotlib/matplotlib

Lists not supported by Axes3D.plot_surface #181

New issue
Copy link
New issue
Copy link
Closed
#394
Closed
Lists not supported by Axes3D.plot_surface#181
#394
Copy link
Assignees
WeatherGod
Labels
status: confirmed bugtopic: mplot3d
Milestone
v1.1.0

Description

@ddale
ddale
opened on Jun 20, 2011
Issue body actions

Original report at SourceForge, opened Thu Dec 16 09:18:48 2010

Lists are not not supported by Axes3D.plot_surface although they are with 2D plots.

The following doesn't work with matplotlib 1.0.0:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

x = [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1, 2, 3, 4, 5]
y = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]
z = [3.09765624, 3.09923861, 3.07380428, 3.03930954, 3.01244428,
3.04109599, 3.06855951, 3.08104518, 3.01577574, 3.02221153,
3.06242075, 3.05325844, 3.03908932, 3.06565395, 3.07982723]

fig = plt.figure()
ax = Axes3D(fig)

plot once for the colors, once for the lines

ax.plot_surface(x, y, z, rstride=1, cstride=1)
ax.set_xlabel(u'X')
ax.set_ylabel(u'Y')
ax.set_zlabel(u'Z')
plt.show()

plt.close(fig)

If you try
plt.plot(x,y), it works.

Traceback (most recent call last):
File "C:\Program Files\eclipse\plugins\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 1145, in
debugger.run(setup['file'], None, None)
File "C:\Program Files\eclipse\plugins\org.python.pydev.debug_1.6.3.2010100513\pysrc\pydevd.py", line 916, in run
execfile(file, globals, locals) #execute the script
File "C:\Users\user\Workspace\general\bug_list.py", line 13, in
ax.plot_surface(x, y, z, rstride=1, cstride=1)
File "C:\Python26\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", line 663, in plot_surface
rows, cols = Z.shape
AttributeError: 'list' object has no attribute 'shape'

Axes3D.plot_wireframe also doesn't work, but Axes3D.plot works.

Activity

  1. WeatherGod commented on Jun 21, 2011

    @WeatherGod
    WeatherGod
    on Jun 21, 2011
    Member
    More actions

    Note, plot_surface and plot_wireframe should be doing a np.asanyarray() to the inputs, but the given code should still fail anyway because they are one dimensional and does not parametrically describe a surface.

  2. ghost assigned
    WeatherGod
    on Jun 21, 2011
  3. WeatherGod
    added a commit that references this issue on Jul 10, 2011

    plot_surface now supports any array-like input. Closes matplotlib#181

    This issue will close once commit 9bb3520 is merged into the 'master' branch.
    9bb3520
  4. WeatherGod
    closed this as completedin 9bb3520on Jul 11, 2011
  5. WeatherGod
    closed this as completedin 84b6f17on Jul 11, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @WeatherGod
    WeatherGod

Labels

status: confirmed bugtopic: mplot3d

Type

No type

Projects

No projects

    Milestone

    • v1.1.0

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.