Draw a line. By default, draw the line via the draw_path() command. Some renderers might wish to override this and provide more fine-grained behavior. In matplotlib, lines are generally created via the plt.plot() command, though this command also can create
(self, data, coordinates, style, label, mplobj=None)
| 159 | self.draw_markers(data, coordinates, markerstyle, label, mplobj) |
| 160 | |
| 161 | def draw_line(self, data, coordinates, style, label, mplobj=None): |
| 162 | """ |
| 163 | Draw a line. By default, draw the line via the draw_path() command. |
| 164 | Some renderers might wish to override this and provide more |
| 165 | fine-grained behavior. |
| 166 | |
| 167 | In matplotlib, lines are generally created via the plt.plot() command, |
| 168 | though this command also can create marker collections. |
| 169 | |
| 170 | Parameters |
| 171 | ---------- |
| 172 | data : array_like |
| 173 | A shape (N, 2) array of datapoints. |
| 174 | coordinates : string |
| 175 | A string code, which should be either 'data' for data coordinates, |
| 176 | or 'figure' for figure (pixel) coordinates. |
| 177 | style : dictionary |
| 178 | a dictionary specifying the appearance of the line. |
| 179 | mplobj : matplotlib object |
| 180 | the matplotlib plot element which generated this line |
| 181 | """ |
| 182 | pathcodes = ["M"] + (data.shape[0] - 1) * ["L"] |
| 183 | pathstyle = dict(facecolor="none", **style) |
| 184 | pathstyle["edgecolor"] = pathstyle.pop("color") |
| 185 | pathstyle["edgewidth"] = pathstyle.pop("linewidth") |
| 186 | self.draw_path( |
| 187 | data=data, |
| 188 | coordinates=coordinates, |
| 189 | pathcodes=pathcodes, |
| 190 | style=pathstyle, |
| 191 | mplobj=mplobj, |
| 192 | ) |
| 193 | |
| 194 | @staticmethod |
| 195 | def _iter_path_collection(paths, path_transforms, offsets, styles): |
no test coverage detected