@@ -182,3 +182,41 @@ def test_makecpt_continuous(grid):
182182 makecpt (cmap = "blue,white" , continuous = True , series = "-4500,4500" )
183183 fig .grdimage (grid , projection = "W0/6i" )
184184 return fig
185+
186+
187+ @check_figures_equal ()
188+ def test_makecpt_categorical (region ):
189+ """
190+ Use static color palette table that is categorical.
191+ """
192+ fig_ref = Figure ()
193+ makecpt (C = "categorical" , W = "" )
194+ fig_ref .colorbar (cmap = True , region = region , frame = True , position = "JBC" )
195+
196+ fig_test = Figure ()
197+ makecpt (cmap = "categorical" , categorical = True )
198+ fig_test .colorbar (cmap = True , region = region , frame = True , position = "JBC" )
199+ return fig_ref , fig_test
200+
201+
202+ @check_figures_equal ()
203+ def test_makecpt_cyclic (region ):
204+ """
205+ Use static color palette table that is cyclic.
206+ """
207+ fig_ref = Figure ()
208+ makecpt (C = "cork" , W = "w" )
209+ fig_ref .colorbar (cmap = True , region = region , frame = True , position = "JBC" )
210+
211+ fig_test = Figure ()
212+ makecpt (cmap = "cork" , cyclic = True )
213+ fig_test .colorbar (cmap = True , region = region , frame = True , position = "JBC" )
214+ return fig_ref , fig_test
215+
216+
217+ def test_makecpt_categorical_and_cyclic (region ):
218+ """
219+ Use incorrect setting by setting both categorical and cyclic to True.
220+ """
221+ with pytest .raises (GMTInvalidInput ):
222+ makecpt (cmap = "batlow" , categorical = True , cyclic = True )
0 commit comments