You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pygmt.show_versions should warn if incompatible packages are installed #3242
When I use the pygmt.Figure.plot command to draw a filled shaded region with a rectangle, I find that regardless of whether I set the transparency to 80 or 100, the effect is always opaque. Transparency doesn't seem to work. (I've output files in both PNG and PDF formats). test.pdf
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.
Transparency doesn't work for the combination of GMT 6.4.0 + Ghostscript 10.03.0. Please upgrade your GMT to 6.5.0 instead. Also please note that PyGMT v0.12.0 has been released.
We already know that some combinations of GMT versions and Ghostscript versions are problematic. I don't think we want to check the GMT/Ghostscript versions when Figure.savefig or Figure.show is called, as the check will cause performance regression. Instead, we can raise a warning when pygmt.show_versions is called, so that users can learn that their GMT/Ghostscript versions are problematic. Thoughts?
Transparency doesn't work for the combination of GMT 6.4.0 + Ghostscript 10.03.0. Please upgrade your GMT to 6.5.0 instead. Also please note that PyGMT v0.12.0 has been released.
Thanks, I will try to upgrade my GMT and PyGMT versions.
We already know that some combinations of GMT versions and Ghostscript versions are problematic. I don't think we want to check the GMT/Ghostscript versions when Figure.savefig or Figure.show is called, as the check will cause performance regression. Instead, we can raise a warning when pygmt.show_versions is called, so that users can learn that their GMT/Ghostscript versions are problematic. Thoughts?
Yes, I completely agree with this idea. I often overlooked this step when installing PyGMT. There is also pygmt.show_versions in the end of the PyGMT installation guide, I think if you can add a short note about these conflicts near the pygmt.show_versions. Of course, it's just a simple idea!
changed the title [-]Why doesn't the transparency of the `pygmt plot` command work anymore?[/-][+]Warn if incompatible packages are installed[/+]on May 11, 2024
changed the title [-]Warn if incompatible packages are installed[/-][+]pygmt.show_versions should warn if incompatible packages are installed[/+]on May 11, 2024
I'm looking at some old issue reports and discussions in the GMT repository and trying to summarize the known facts about faulty ghostscript + GMT versions:
I'm looking at some old issue reports and discussions in the GMT repository and trying to summarize the known facts about faulty ghostscript + GMT versions:
gs 9.53 was released in 2020, so I guess that no one is using such old versions.
Based on the above facts and that PyGMT supports GMT>=6.3, I think we should warn in the following cases:
gs < 9.53: too old and some versions are known to have bugs
gs 9.53-9.56: Good
gs 10.00/10.01: buggy
gs 10.02/10.03: good but should warn for GMT<=6.4
Absolutely agree with you! Thanks for giving these warnings in the PyGMT, and I think these warnings will be useful for choosing the appropriate PyGMT and gs versions to use.
We already know that some combinations of GMT versions and Ghostscript versions are problematic. I don't think we want to check the GMT/Ghostscript versions when Figure.savefig or Figure.show is called, as the check will cause performance regression. Instead, we can raise a warning when pygmt.show_versions is called, so that users can learn that their GMT/Ghostscript versions are problematic. Thoughts?
I also started wondering whether it makes sense to add somewhere a note or warning regarding this transparency-GMT-ghostscript issue, after several reports on GitHub and the GMT forum.
As running pygmt.show_versions is recommended after the installation of PyGMT, at least the users who do this will directly see if there is a GMT-ghostscript incompatibility. Also when reporting bugs, the output of pygmt.show_versions should be reported. So, adding such a warning to pygmt.show_versions makes sense to me.
I was just thinking about such a modification of the current example. I prefer to have an example from which the user can see directly that there is an error regarding the transparency. So far, I wrote two different examples, but I am not 100 % happy. For the first example, I feel a not working transparency is not directly visible, as the figure does not look really wrong. The second example is somehow constructed. Maybe we have to add a sentence as explanation?
importpygmt# (I) (a) Test if transparency is workingfig=pygmt.Figure()
fig.basemap(projection="N10c", region="g", frame="afg30")
fig.coast(land="tan", water="lightblue@50")
fig.show()
# (I) (b) Simulate NOT working transparencyfig=pygmt.Figure()
fig.basemap(projection="N10c", region="g", frame="afg30")
fig.coast(land="tan", water="lightblue")
fig.show()
# -----------------------------------------------------------------------------# (II) (a) Test if transparency is workingfig=pygmt.Figure()
fig.coast(projection="N10c", region="g", land="tan", water="lightblue", frame=True)
fig.coast(land="white@99", water="white@99")
fig.show()
# (II) (b) Simulate NOT working transparencyfig=pygmt.Figure()
fig.coast(projection="N10c", region="g", land="tan", water="lightblue", frame=True)
fig.coast(land="white", water="white")
fig.show()
The text looks cool with the transparency effect 😀!
However, I see again the issue that the figure does not really look wrong in case the transparency is not working. So we probably need to add a comment on what users should focus, as new users are probably unfamiliar with creating transparency in [Py]GMT.
However, I see again the issue that the figure does not really look wrong in case the transparency is not working. So we probably need to add a comment on what users should focus, as new users are probably unfamiliar with creating transparency in [Py]GMT.
Yes, we need a sentence explaining what the users are expected to see.
Your two examples are also technically correct, but for (I), users are expected to see gridlines but new users may have no ideas about what gridlines means in GMT/PyGMT; for (II), using two Figure.coast calls looks weird.
Activity
welcome commentedon May 11, 2024
👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.
seisman commentedon May 11, 2024
Transparency doesn't work for the combination of GMT 6.4.0 + Ghostscript 10.03.0. Please upgrade your GMT to 6.5.0 instead. Also please note that PyGMT v0.12.0 has been released.
seisman commentedon May 11, 2024
@GenericMappingTools/pygmt-maintainers
We already know that some combinations of GMT versions and Ghostscript versions are problematic. I don't think we want to check the GMT/Ghostscript versions when
Figure.savefigorFigure.showis called, as the check will cause performance regression. Instead, we can raise a warning whenpygmt.show_versionsis called, so that users can learn that their GMT/Ghostscript versions are problematic. Thoughts?cuitianyu20 commentedon May 11, 2024
Thanks, I will try to upgrade my GMT and PyGMT versions.
cuitianyu20 commentedon May 11, 2024
Yes, I completely agree with this idea. I often overlooked this step when installing PyGMT. There is also
pygmt.show_versionsin the end of the PyGMT installation guide, I think if you can add a short note about these conflicts near thepygmt.show_versions. Of course, it's just a simple idea![-]Why doesn't the transparency of the `pygmt plot` command work anymore?[/-][+]Warn if incompatible packages are installed[/+][-]Warn if incompatible packages are installed[/-][+]pygmt.show_versions should warn if incompatible packages are installed[/+]seisman commentedon May 11, 2024
I'm looking at some old issue reports and discussions in the GMT repository and trying to summarize the known facts about faulty ghostscript + GMT versions:
gs 9.53 was released in 2020, so I guess that no one is using such old versions.
Based on the above facts and that PyGMT supports GMT>=6.3, I think we should warn in the following cases:
cuitianyu20 commentedon May 11, 2024
Absolutely agree with you! Thanks for giving these warnings in the PyGMT, and I think these warnings will be useful for choosing the appropriate PyGMT and gs versions to use.
yvonnefroehlich commentedon May 11, 2024
I also started wondering whether it makes sense to add somewhere a note or warning regarding this transparency-GMT-ghostscript issue, after several reports on GitHub and the GMT forum.
As running
pygmt.show_versionsis recommended after the installation of PyGMT, at least the users who do this will directly see if there is a GMT-ghostscript incompatibility. Also when reporting bugs, the output ofpygmt.show_versionsshould be reported. So, adding such a warning topygmt.show_versionsmakes sense to me.Maybe we can add additionally a note under the common-installation-issues section?
Do we need a reminder in the release checklist regarding updating this warning before each release?
seisman commentedon May 12, 2024
That's a very good point! I think we also should update the "Get Started" test (https://www.pygmt.org/dev/#getting-started) to add a transparency element.
Makes sense to me.
yvonnefroehlich commentedon May 13, 2024
I was just thinking about such a modification of the current example. I prefer to have an example from which the user can see directly that there is an error regarding the transparency. So far, I wrote two different examples, but I am not 100 % happy. For the first example, I feel a not working transparency is not directly visible, as the figure does not look really wrong. The second example is somehow constructed. Maybe we have to add a sentence as explanation?
seisman commentedon May 13, 2024
I was thinking about an example like:
yvonnefroehlich commentedon May 13, 2024
The text looks cool with the transparency effect 😀!
However, I see again the issue that the figure does not really look wrong in case the transparency is not working. So we probably need to add a comment on what users should focus, as new users are probably unfamiliar with creating transparency in [Py]GMT.
seisman commentedon May 13, 2024
Yes, we need a sentence explaining what the users are expected to see.
Your two examples are also technically correct, but for (I), users are expected to see gridlines but new users may have no ideas about what gridlines means in GMT/PyGMT; for (II), using two Figure.coast calls looks weird.
seisman commentedon May 13, 2024
@yvonnefroehlich Do you want to work on it?
yvonnefroehlich commentedon May 14, 2024
Yes, I like to work on this. I just submitted PR #3249; will do the remain aspects in then next (hopefully two) days.