On Tue, Nov 20, 2012 at 12:55 AM, Stephen Gibson
<stephen.gib...@anu.edu.au>wrote:
> I want to plot a series of (x,y) datasets similar to the
> polygon plot tutorial example (add_collection3d),
> but with a transparent facecolor and no baseline.
>
>
> Setting alpha=0.0 in the tutorial example (below)
> achieves the transparency, but the baseline remains.
>
> Is there a way to remove the baseline?
>
> Tks,
>
> Steve.
>
>
> from mpl_toolkits.mplot3d import Axes3D
> from matplotlib.collections import PolyCollection
> from matplotlib.colors import colorConverter
> import matplotlib.pyplot as plt
> import numpy as np
>
> fig = plt.figure()
> ax = fig.gca(projection='3d')
>
> cc = lambda arg: colorConverter.to_rgba(arg, alpha=0.0)
>
> xs = np.arange(0, 10, 0.4)
> verts = []
> zs = [0.0, 1.0, 2.0, 3.0]
> for z in zs:
> ys = np.random.rand(len(xs))
> ys[0], ys[-1] = 0, 0
> verts.append(list(zip(xs, ys)))
>
> poly = PolyCollection(verts, facecolors = [cc('r'), cc('g'), cc('b'),
> cc('y')])
> #poly.set_alpha(0.7)
> ax.add_collection3d(poly, zs=zs, zdir='y')
>
> ax.set_xlabel('X')
> ax.set_xlim3d(0, 10)
> ax.set_ylabel('Y')
> ax.set_ylim3d(-1, 4)
> ax.set_zlabel('Z')
> ax.set_zlim3d(0, 1)
>
>
You should be able to set "edgecolors='none'" or as the same color as the
facecolors in the constructor for PolyCollection to make it disappear.
Unfortunately, that would apply to the entire polygon, and not just the
part at the base.
Ben Root
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users