We need to update the documentation for the transparency parameter in plot and plot3d because transparency can also be 1d array.
See the description of the transparency parameter of plot:
transparency (int or float) – Set transparency level, in [0-100] percent range. Default is 0, i.e., opaque. Only visible when PDF or raster format output is selected. Only the PNG format selection adds a transparency layer in the image (for further processing). transparency can also be a 1d array to set varying transparency for symbols.
See the description of the transparency parameter of plot3d:
transparency (int or float) – Set transparency level, in [0-100] percent range. Default is 0, i.e., opaque. Only visible when PDF or raster format output is selected. Only the PNG format selection adds a transparency layer in the image (for further processing). transparency can also be a 1d array to set varying transparency for symbols.
We can see that transparency can be 1d array at the end of the above description, but it is missing at the beginning. See the example of Points with varying transparency using a 1d array as transparency.
A GMTInvalidInput is raised for an array-like transparency when the data parameter is used in #1065. We may add a test for this kind of invalid input. A test called test_plot_fail_color_size_intensity is updated in #1065 for 1d-array color, sizes, and intensity when data parameter is used. It should be easy to add transparency in this test function, which may have a more general name, e.g.,test_plot_fail_1d_array_with_data
Description of the problem
We need to update the documentation for the
transparency
parameter in plot and plot3d becausetransparency
can also be1d array
.See the description of the
transparency
parameter of plot:See the description of the
transparency
parameter of plot3d:We can see that
transparency
can be 1d array at the end of the above description, but it is missing at the beginning. See the example of Points with varying transparency using a 1d array astransparency
.Meanwhile, array-like
transparency
doesn't work for thedata
parameter. It is only valid forx
/y
like thesizes
parameter. (originally posted in https://github.com/GenericMappingTools/pygmt/pull/1065#discussion_r598100163).A
GMTInvalidInput
is raised for an array-liketransparency
when thedata
parameter is used in #1065. We may add a test for this kind of invalid input. A test calledtest_plot_fail_color_size_intensity
is updated in #1065 for 1d-arraycolor
,sizes
, andintensity
whendata
parameter is used. It should be easy to addtransparency
in this test function, which may have a more general name, e.g.,test_plot_fail_1d_array_with_data