Skip to content

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

Closed

Description

@core-man

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

Activity

  1. added
    bug
    on Mar 22, 2021
  2. seisman commented on Mar 23, 2021

    @seisman
    Member

    Sounds good to me.

  3. added
    documentation
    help wanted
    and removed
    bug
    on Mar 25, 2021
  4. added this to the 0.4.0 milestone on Mar 25, 2021
  5. self-assigned this
    on Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

documentationhelp wanted

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions