Skip to content

Varying transparency levels for plot, plot3d and text #615

Closed

Description

@seisman

Description of the desired feature

#614 added the transparency argument to all plotting functions. In most functions, transparency can be an int/float value in 0-100. For a few functions (plot, plot3d and text), transparency can be a list to have varying transparency for symbols and texts.

We should extend these functions to support the varying transparency feature.

Are you willing to help implement and maintain this feature? Yes

Activity

  1. weiji14 commented on Dec 6, 2020

    @weiji14
    Member

    Record by record transparency has been added to plot at #626, and also plot3d at #471, so what's left is just adding it to text?

    On a side note, we might want to add a test for grdimage with transparency. I'm getting this error on PyGMT v0.2.1, GMT 6.2.0_92c5676_2020.11.10 with ghostscript 9.53.3:

    fig = pygmt.Figure()
    fig.grdimage(grid="@earth_relief_01d", transparency=70)
    fig.show()
    GMTCLibError: Module 'psconvert' failed with status code 79:
    psconvert [ERROR]: System call [gs -q -dNOPAUSE -dBATCH -dNOSAFER -dPDFSETTINGS=/prepress -dDownsampleColorImages=false -dDownsampleGrayImages=false -dDownsampleMonoImages=false -dUseFlateCompression=true -dEmbedAllFonts=true -dSubsetFonts=true -dMonoImageFilter=/FlateEncode -dAutoFilterGrayImages=false -dGrayImageFilter=/FlateEncode -dAutoFilterColorImages=false -dColorImageFilter=/FlateEncode -dSCANCONVERTERTYPE=2 -dALLOWPSTRANSPARENCY -dMaxBitmap=2147483647 -dUseFastColor=true -dGraphicsAlphaBits=1 -dTextAlphaBits=1 -sDEVICE=pdfwrite  -g1772x886 -r300 -sOutputFile='/home/user/.gmt/sessions/gmt_session.62321/gmt_13_intermediate.pdf' '/home/user/.gmt/sessions/gmt_session.62321/psconvert_62321d.eps'] returned error 256.
                          
    

    Will submit a proper bug report once I can isolate the issue.

  2. seisman commented on Dec 6, 2020

    @seisman
    MemberAuthor

    Record by record transparency has been added to plot at #626, and also plot3d at #471, so what's left is just adding it to text?

    Yes, I think I already have a local branch for the text transparency. Will check if it works as expected and submit it later.

    On a side note, we might want to add a test for grdimage with transparency. I'm getting this error on PyGMT v0.2.1, GMT 6.2.0_92c5676_2020.11.10 with ghostscript 9.53.3:

    I can't reproduce your issue, using PyGMT v0.2.2.dev14+g1547ad41 + GMT 6.2.0_74efdca_2020.12.06 + Ghostscript 9.53.3 on macOS.

  3. weiji14 commented on Dec 6, 2020

    @weiji14
    Member

    Yes, I think I already have a local branch for the text transparency. Will check if it works as expected and submit it later.

    Great! No rush though, I was just searching for transparency examples and saw this issue was still open

    On a side note, we might want to add a test for grdimage with transparency. I'm getting this error on PyGMT v0.2.1, GMT 6.2.0_92c5676_2020.11.10 with ghostscript 9.53.3:

    I can't reproduce your issue, using PyGMT v0.2.2.dev14+g1547ad41 + GMT 6.2.0_74efdca_2020.12.06 + Ghostscript 9.53.3 on macOS.

    Yeah, I might need to update my GMT dev version, can't reproduce this on try-gmt either :/ Maybe GenericMappingTools/gmt#4464 fixed this.

  4. added this to the 0.3.0 milestone on Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions