- Timestamp:
- 09/18/12 15:04:55 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UQ/math/legacy/plot_data.py
r562 r563 67 67 68 68 #### plotting the cones #### 69 def plot_cones(ax, data, slope, bounds ):69 def plot_cones(ax, data, slope, bounds, color='0.75'): 70 70 """plot double cones for a given dataset 71 71 … … 74 74 slope -- slope multiplier for cone on the X,Y,Z axes (for mesh construction) 75 75 bounds -- list of tuples of bounds for the plot; (lower,upper) for each axis 76 color -- string name (or rbg value) of color to use for datapoints 76 77 """ 77 78 cone = cone_builder(slope, bounds) … … 81 82 if _cone: 82 83 X,Z,Y = _cone 83 ax.plot_surface(X, Z,Y, rstride=1, cstride=1, color= "0.75")84 ax.plot_surface(X, Z,Y, rstride=1, cstride=1, color=color) 84 85 _cone = cone(datapt, top=False) 85 86 if _cone: 86 87 X,Z,Y = _cone 87 ax.plot_surface(X, Z,Y, rstride=1, cstride=1, color= "0.75")88 ax.plot_surface(X, Z,Y, rstride=1, cstride=1, color=color) 88 89 return ax 89 90 90 def plot_data(ax, data, bounds ):91 def plot_data(ax, data, bounds, color='red'): 91 92 """plot datapoints for a given dataset 92 93 … … 94 95 data -- list of datapoints, where datapoints are 3-tuples (i.e. x,y,z) 95 96 bounds -- list of tuples of bounds for the plot; (lower,upper) for each axis 97 color -- string name (or rbg value) of color to use for datapoints 96 98 """ 97 99 strict = True # always respect the bounds … … 107 109 else: 108 110 ax.plot([datapt[0]], [datapt[2]], [datapt[1]], \ 109 color= 'r', marker='o', markersize=10)111 color=color, marker='o', markersize=10) 110 112 return ax 111 113 … … 184 186 plot_cones(ax, coords, slope, bounds) 185 187 plot_data(ax, coords, bounds) 186 188 #clip_axes(ax, bounds) 187 189 plt.show() 188 190
Note: See TracChangeset
for help on using the changeset viewer.