Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

backend_pdf.py fails on 3d plots (1.3.x) #1933

Closed
Assignees
dmcdougall
@aviolov

Description

@aviolov

Hi

I just github'd matplotlib's (1.3.x) version using git clone git://github.com/matplotlib/matplotlib.git

and I noted an issue with the backend_pdf.py script

In particular the following code
else:
##facecolors = np.array(facecolors); ##CRUDE WORKAROUND, NOT IN GITHUB SOURCE
if np.all(facecolors[:, 3] == facecolors[0, 3]):
filled = facecolors[0, 3] != 0.0
else:
can_do_optimization = False
will error since facecolors is a LIST but is treated like an NUMPY.ARRAY

The commented out code
##facecolors = np.array(facecolors);
is a crude workaround, that will fix this issue if it is uncommented at least in the code below.

The exact same problem occurs later in the script using the LIST edgecolors

in order to reproduce the bug, one can use the following script, which would throw an error about indexing lists like numpy arrays:

ifname == 'main':
from pylab import *

import matplotlibprint matplotlib.__version__from mpl_toolkits.mplot3d import Axes3Dfig = figure();ax = fig.add_subplot(1,1, 1, projection='3d')ax.view_init(elev = None, azim= -15)xs = arange(3)ts = arange(3);X, Y = np.meshgrid(xs, ts)Fs = X*Y;ax.plot_surface(X, Y, Fs, cmap=cm.jet,                        linewidth=0, antialiased=False)savefig('testpdf.pdf')show()

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp