2
2
Histogram - Create a histogram
3
3
"""
4
4
from pygmt .clib import Session
5
- from pygmt .helpers import build_arg_string , fmt_docstring , kwargs_to_strings , use_alias
5
+ from pygmt .helpers import (
6
+ build_arg_string ,
7
+ deprecate_parameter ,
8
+ fmt_docstring ,
9
+ kwargs_to_strings ,
10
+ use_alias ,
11
+ )
6
12
7
13
8
14
@fmt_docstring
15
+ @deprecate_parameter ("table" , "data" , "v0.5.0" , remove_version = "v0.7.0" )
9
16
@use_alias (
10
17
A = "horizontal" ,
11
18
B = "frame" ,
41
48
@kwargs_to_strings (
42
49
R = "sequence" , T = "sequence" , c = "sequence_comma" , i = "sequence_comma" , p = "sequence"
43
50
)
44
- def histogram (self , table , ** kwargs ):
51
+ def histogram (self , data , ** kwargs ):
45
52
r"""
46
53
Plots a histogram, and can read data from a file or
47
54
list, array, or dataframe.
@@ -52,7 +59,7 @@ def histogram(self, table, **kwargs):
52
59
53
60
Parameters
54
61
----------
55
- table : str or list or {table-like}
62
+ data : str or list or {table-like}
56
63
Pass in either a file name to an ASCII data table, a Python list, a 2D
57
64
{table-classes}.
58
65
{J}
@@ -139,7 +146,7 @@ def histogram(self, table, **kwargs):
139
146
"""
140
147
kwargs = self ._preprocess (** kwargs ) # pylint: disable=protected-access
141
148
with Session () as lib :
142
- file_context = lib .virtualfile_from_data (check_kind = "vector" , data = table )
149
+ file_context = lib .virtualfile_from_data (check_kind = "vector" , data = data )
143
150
with file_context as infile :
144
151
arg_str = " " .join ([infile , build_arg_string (kwargs )])
145
152
lib .call_module ("histogram" , arg_str )
0 commit comments