@@ -736,7 +736,7 @@ def candlestick_ohlc(ax, quotes, width=0.2, colorup='k', colordown='r',
736
736
737
737
738
738
def _candlestick (ax , quotes , width = 0.2 , colorup = 'k' , colordown = 'r' ,
739
- alpha = 1.0 , ochl = True ):
739
+ alpha = 1.0 , ochl = True ):
740
740
741
741
"""
742
742
Plot the time, open, high, low, close as a vertical line ranging
@@ -817,7 +817,7 @@ def _candlestick(ax, quotes, width=0.2, colorup='k', colordown='r',
817
817
818
818
819
819
def _check_input (opens , closes , highs , lows , miss = - 1 ):
820
- """Checks that *opens*, *highs*, *lows* and *closes* have the same length.
820
+ """Checks that *opens*, *highs*, *lows* and *closes* have the same length.
821
821
NOTE: this code assumes if any value open, high, low, close is
822
822
missing (*-1*) they all are missing
823
823
@@ -833,86 +833,48 @@ def _check_input(opens, closes, highs, lows, miss=-1):
833
833
sequence of low values
834
834
closes : sequence
835
835
sequence of closing values
836
- miss:
836
+ miss : int
837
837
identifier of the missing data
838
+
839
+ Raises
840
+ ------
841
+ ValueError
842
+ if the input sequences don't have the same length
838
843
"""
839
844
840
845
def _missing (sequence , miss = - 1 ):
841
846
"""Returns the index in *sequence* of the missing data, identified by
842
847
*miss*
848
+
843
849
Parameters
844
850
----------
845
- sequence:
851
+ sequence :
846
852
sequence to evaluate
847
- miss:
853
+ miss :
848
854
identifier of the missing data
849
855
850
856
Returns
851
857
-------
852
858
where_miss: numpy.ndarray
853
859
indices of the missing data
854
860
"""
855
- return np .where (np .array (sequence )== miss )[0 ]
861
+ return np .where (np .array (sequence ) == miss )[0 ]
856
862
857
863
same_length = (len (opens ) == len (highs )) and (len (opens ) == len (lows )) and \
858
864
(len (opens ) == len (closes ))
859
865
_missopens = _missing (opens )
860
- same_missing = (_missopens == _missing (highs )).all () and (_missopens == \
866
+ same_missing = (_missopens == _missing (highs )).all () and (_missopens ==
861
867
_missing (lows )).all () and (_missopens == _missing (closes )).all ()
862
868
863
869
if not (same_length and same_missing ):
864
870
msg = """
865
- *opens*, *highs*, *lows* and *closes* must have the same length.
871
+ *opens*, *highs*, *lows* and *closes* must have the same length.
866
872
NOTE: this code assumes if any value open, high, low, close is
867
873
missing (*-1*) they all must be missing
868
874
"""
869
875
raise ValueError (msg )
870
876
871
877
872
- def plot_day_summary2 (ax , opens , closes , highs , lows , ticksize = 4 ,
873
- colorup = 'k' , colordown = 'r' ,
874
- ):
875
- """Represent the time, open, close, high, low, as a vertical line
876
- ranging from low to high. The left tick is the open and the right
877
- tick is the close.
878
-
879
-
880
- This function has been deprecated in 1.4 in favor of
881
- `plot_day_summary2_ochl`, which maintains the original argument
882
- order, or `plot_day_summary2_ohlc`, which uses the
883
- open-high-low-close order. This function will be removed in 1.5
884
-
885
-
886
- Parameters
887
- ----------
888
- ax : `Axes`
889
- an Axes instance to plot to
890
- opens : sequence
891
- sequence of opening values
892
- closes : sequence
893
- sequence of closing values
894
- highs : sequence
895
- sequence of high values
896
- lows : sequence
897
- sequence of low values
898
- ticksize : int
899
- size of open and close ticks in points
900
- colorup : color
901
- the color of the lines where close >= open
902
- colordown : color
903
- the color of the lines where close < open
904
-
905
- Returns
906
- -------
907
- ret : list
908
- a list of lines added to the axes
909
- """
910
-
911
- warnings .warn (_warn_str .format (fun = 'plot_day_summary2' ), mplDeprecation )
912
- return plot_day_summary2_ohlc (ax , opens , highs , lows , closes , ticksize ,
913
- colorup , colordown )
914
-
915
-
916
878
def plot_day_summary2_ochl (ax , opens , closes , highs , lows , ticksize = 4 ,
917
879
colorup = 'k' , colordown = 'r' ,
918
880
):
0 commit comments