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

Varying transparency levels for plot, plot3d and text #615

Closed
seisman opened this issue Sep 18, 2020 · 3 comments · Fixed by #716
Closed

Varying transparency levels for plot, plot3d and text #615

seisman opened this issue Sep 18, 2020 · 3 comments · Fixed by #716
Labels
feature request New feature wanted
Milestone

Comments

@seisman
Copy link
Member

seisman commented Sep 18, 2020

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

@weiji14
Copy link
Member

weiji14 commented Dec 6, 2020

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.

@seisman
Copy link
Member Author

seisman commented Dec 6, 2020

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.

@weiji14
Copy link
Member

weiji14 commented Dec 6, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature wanted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants