Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The transparency parameter of plot/plot3d methods can be 1d array #1098

Closed
core-man opened this issue Mar 22, 2021 · 1 comment · Fixed by #1265
Closed

The transparency parameter of plot/plot3d methods can be 1d array #1098

core-man opened this issue Mar 22, 2021 · 1 comment · Fixed by #1265
Assignees
Labels
documentation Improvements or additions to documentation help wanted Helping hands are appreciated
Milestone

Comments

@core-man
Copy link
Member

core-man commented Mar 22, 2021

Description of the problem

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.


Meanwhile, array-like transparency doesn't work for the data parameter. It is only valid for x/y like the sizes parameter. (originally posted in #1065 (comment)).

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

@core-man core-man added the bug Something isn't working label Mar 22, 2021
@seisman
Copy link
Member

seisman commented Mar 23, 2021

Sounds good to me.

@seisman seisman added documentation Improvements or additions to documentation help wanted Helping hands are appreciated and removed bug Something isn't working labels Mar 25, 2021
@seisman seisman added this to the 0.4.0 milestone Mar 25, 2021
@core-man core-man self-assigned this Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Helping hands are appreciated
Projects
None yet
2 participants