22Histogram - Create a histogram
33"""
44from 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+ )
612
713
814@fmt_docstring
15+ @deprecate_parameter ("table" , "data" , "v0.5.0" , remove_version = "v0.7.0" )
916@use_alias (
1017 A = "horizontal" ,
1118 B = "frame" ,
4148@kwargs_to_strings (
4249 R = "sequence" , T = "sequence" , c = "sequence_comma" , i = "sequence_comma" , p = "sequence"
4350)
44- def histogram (self , table , ** kwargs ):
51+ def histogram (self , data , ** kwargs ):
4552 r"""
4653 Plots a histogram, and can read data from a file or
4754 list, array, or dataframe.
@@ -52,7 +59,7 @@ def histogram(self, table, **kwargs):
5259
5360 Parameters
5461 ----------
55- table : str or list or {table-like}
62+ data : str or list or {table-like}
5663 Pass in either a file name to an ASCII data table, a Python list, a 2D
5764 {table-classes}.
5865 {J}
@@ -139,7 +146,7 @@ def histogram(self, table, **kwargs):
139146 """
140147 kwargs = self ._preprocess (** kwargs ) # pylint: disable=protected-access
141148 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 )
143150 with file_context as infile :
144151 arg_str = " " .join ([infile , build_arg_string (kwargs )])
145152 lib .call_module ("histogram" , arg_str )
0 commit comments