Advertisement
Guest User

Untitled

a guest
Apr 26th, 2017
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.98 KB | None | 0 0
  1. bioneuron_oracle/tests/test_feedforward.py:60: in feedforward
  2. plt.subplots(3, 1, 1)
  3. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  4.  
  5. nrows = 3, ncols = 1, sharex = 1, sharey = 'none', squeeze = True
  6. subplot_kw = None, gridspec_kw = None, fig_kw = {}
  7. share_values = ['all', 'row', 'col', 'none']
  8.  
  9. def subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True,
  10. subplot_kw=None, gridspec_kw=None, **fig_kw):
  11. """
  12. Create a figure and a set of subplots
  13.  
  14. This utility wrapper makes it convenient to create common layouts of
  15. subplots, including the enclosing figure object, in a single call.
  16.  
  17. Parameters
  18. ----------
  19. nrows, ncols : int, optional, default: 1
  20. Number of rows/columns of the subplot grid.
  21.  
  22. sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False
  23. Controls sharing of properties among x (`sharex`) or y (`sharey`)
  24. axes:
  25.  
  26. - True or 'all': x- or y-axis will be shared among all
  27. subplots.
  28. - False or 'none': each subplot x- or y-axis will be
  29. independent.
  30. - 'row': each subplot row will share an x- or y-axis.
  31. - 'col': each subplot column will share an x- or y-axis.
  32.  
  33. When subplots have a shared x-axis along a column, only the x tick
  34. labels of the bottom subplot are visible. Similarly, when subplots
  35. have a shared y-axis along a row, only the y tick labels of the first
  36. column subplot are visible.
  37.  
  38. squeeze : bool, optional, default: True
  39. - If True, extra dimensions are squeezed out from the returned Axes
  40. object:
  41.  
  42. - if only one subplot is constructed (nrows=ncols=1), the
  43. resulting single Axes object is returned as a scalar.
  44. - for Nx1 or 1xN subplots, the returned object is a 1D numpy
  45. object array of Axes objects are returned as numpy 1D arrays.
  46. - for NxM, subplots with N>1 and M>1 are returned as a 2D arrays.
  47.  
  48. - If False, no squeezing at all is done: the returned Axes object is
  49. always a 2D array containing Axes instances, even if it ends up
  50. being 1x1.
  51.  
  52. subplot_kw : dict, optional
  53. Dict with keywords passed to the
  54. :meth:`~matplotlib.figure.Figure.add_subplot` call used to create each
  55. subplot.
  56.  
  57. gridspec_kw : dict, optional
  58. Dict with keywords passed to the
  59. :class:`~matplotlib.gridspec.GridSpec` constructor used to create the
  60. grid the subplots are placed on.
  61.  
  62. fig_kw : dict, optional
  63. Dict with keywords passed to the :func:`figure` call. Note that all
  64. keywords not recognized above will be automatically included here.
  65.  
  66. Returns
  67. -------
  68. fig : :class:`matplotlib.figure.Figure` object
  69.  
  70. ax : Axes object or array of Axes objects.
  71.  
  72. ax can be either a single :class:`matplotlib.axes.Axes` object or an
  73. array of Axes objects if more than one subplot was created. The
  74. dimensions of the resulting array can be controlled with the squeeze
  75. keyword, see above.
  76.  
  77. Examples
  78. --------
  79. First create some toy data:
  80.  
  81. >>> x = np.linspace(0, 2*np.pi, 400)
  82. >>> y = np.sin(x**2)
  83.  
  84. Creates just a figure and only one subplot
  85.  
  86. >>> fig, ax = plt.subplots()
  87. >>> ax.plot(x, y)
  88. >>> ax.set_title('Simple plot')
  89.  
  90. Creates two subplots and unpacks the output array immediately
  91.  
  92. >>> f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)
  93. >>> ax1.plot(x, y)
  94. >>> ax1.set_title('Sharing Y axis')
  95. >>> ax2.scatter(x, y)
  96.  
  97. Creates four polar axes, and accesses them through the returned array
  98.  
  99. >>> fig, axes = plt.subplots(2, 2, subplot_kw=dict(polar=True))
  100. >>> axes[0, 0].plot(x, y)
  101. >>> axes[1, 1].scatter(x, y)
  102.  
  103. Share a X axis with each column of subplots
  104.  
  105. >>> plt.subplots(2, 2, sharex='col')
  106.  
  107. Share a Y axis with each row of subplots
  108.  
  109. >>> plt.subplots(2, 2, sharey='row')
  110.  
  111. Share both X and Y axes with all subplots
  112.  
  113. >>> plt.subplots(2, 2, sharex='all', sharey='all')
  114.  
  115. Note that this is the same as
  116.  
  117. >>> plt.subplots(2, 2, sharex=True, sharey=True)
  118.  
  119. See Also
  120. --------
  121. figure
  122. subplot
  123. """
  124. # for backwards compatibility
  125. if isinstance(sharex, bool):
  126. if sharex:
  127. sharex = "all"
  128. else:
  129. sharex = "none"
  130. if isinstance(sharey, bool):
  131. if sharey:
  132. sharey = "all"
  133. else:
  134. sharey = "none"
  135. share_values = ["all", "row", "col", "none"]
  136. if sharex not in share_values:
  137. # This check was added because it is very easy to type
  138. # `subplots(1, 2, 1)` when `subplot(1, 2, 1)` was intended.
  139. # In most cases, no error will ever occur, but mysterious behavior will
  140. # result because what was intended to be the subplot index is instead
  141. # treated as a bool for sharex.
  142. if isinstance(sharex, int):
  143. warnings.warn("sharex argument to subplots() was an integer."
  144. " Did you intend to use subplot() (without 's')?")
  145.  
  146. raise ValueError("sharex [%s] must be one of %s" %
  147. > (sharex, share_values))
  148. E ValueError: sharex [1] must be one of [u'all', u'row', u'col', u'none']
  149.  
  150. ../.virtualenvs/oracle/local/lib/python2.7/site-packages/matplotlib/pyplot.py:1194: ValueError
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement