| @@ 715-719 (lines=5) @@ | ||
| 712 | 'silver', 'lime', 'pink', 'gold', 'bisque' ]; |
|
| 713 | ||
| 714 | if (len(clusters) > len(colors)): |
|
| 715 | raise NameError('Impossible to represent clusters due to number of specified colors.');
|
|
| 716 | ||
| 717 | fig = plt.figure(); |
|
| 718 | ||
| 719 | if (axes is None): |
|
| 720 | # Check for dimensions |
|
| 721 | if ((dimension) == 1 or (dimension == 2)): |
|
| 722 | axes = fig.add_subplot(111); |
|
| @@ 694-698 (lines=5) @@ | ||
| 691 | @param[in] marker_descr (string): Marker for displaying points. |
|
| 692 | @param[in] hide_axes (bool): If True - axes is not displayed. |
|
| 693 | @param[in] axes (ax) Matplotlib axes where clusters should be drawn, if it is not specified (None) then new plot will be created. |
|
| 694 | @param[in] display_result (bool): If specified then matplotlib axes will be used for drawing and plot will not be shown. |
|
| 695 | ||
| 696 | @return (ax) Matplotlib axes where drawn clusters are presented. |
|
| 697 | ||
| 698 | """ |
|
| 699 | # Get dimension |
|
| 700 | dimension = 0; |
|
| 701 | if ( (data is not None) and (clusters is not None) ): |
|
| @@ 329-333 (lines=5) @@ | ||
| 326 | else: |
|
| 327 | ax.plot(data[item][0], data[item][1], color = color, marker = marker, markersize = markersize); |
|
| 328 | ||
| 329 | elif (dimension == 3): |
|
| 330 | if (data is None): |
|
| 331 | ax.scatter(item[0], item[1], item[2], c = color, marker = marker, s = markersize); |
|
| 332 | else: |
|
| 333 | ax.scatter(data[item][0], data[item][1], data[item][2], c = color, marker = marker, s = markersize); |
|