Closed cuitianyu20 closed 6 months ago
đź‘‹ 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.
@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.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.
@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.savefig
orFigure.show
is called, as the check will cause performance regression. Instead, we can raise a warning whenpygmt.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!
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:
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:
- GMT 6.3/6.4 + Ghostscript 10 doesn't support transparency Update psconvert to handle gs version 10Â gmt#7096
- Gs 10.00 and 10.01.2 are buggy: New gs 10.01.0 from brew yields many subtle failures gmt#7336 (comment), but gs 10.02 look good New gs 10.01.0 from brew yields many subtle failures gmt#7336 (comment).
- gs 10.03 is the latest version and is good, since no one complains about it.
- gs 9.56 is the latest version of gs 9, and it's good.
- gs 9.53-9.56 should be good per Better warnings for faulty gs gmt#3282 (comment)
- gs 9.51 and 9.52 are faulty Better warnings for faulty gs gmt#3282 (comment)
- gs 9.50 should be good transparency problem gmt#3798 (comment)
- gs 9.27 is buggy GhostScript 9.27 released with yet another bug gmt#880
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.
@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.savefig
orFigure.show
is called, as the check will cause performance regression. Instead, we can raise a warning whenpygmt.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.
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?
Maybe we can add additionally a note under the common-installation-issues section?
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.
import pygmt
fig = pygmt.Figure()
fig.coast(projection="H10c", region="g", frame=True, land="gray")
fig.show()
Do we need a reminder in the release checklist regarding updating this warning before each release?
Makes sense to me.
I think we also should update the "Get Started" test (https://www.pygmt.org/dev/#getting-started) to add a transparency element.
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?
import pygmt
# (I) (a) Test if transparency is working
fig = pygmt.Figure()
fig.basemap(projection="N10c", region="g", frame="afg30")
fig.coast(land="tan", water="lightblue@50")
fig.show()
# (I) (b) Simulate NOT working transparency
fig = pygmt.Figure()
fig.basemap(projection="N10c", region="g", frame="afg30")
fig.coast(land="tan", water="lightblue")
fig.show()
# -----------------------------------------------------------------------------
# (II) (a) Test if transparency is working
fig = 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 transparency
fig = pygmt.Figure()
fig.coast(projection="N10c", region="g", land="tan", water="lightblue", frame=True)
fig.coast(land="white", water="white")
fig.show()
(I) (a) working transparncy | (I) (b) NOT working transparency |
---|---|
(II) (a) working transparncy | (II) (b) NOT working transparency |
---|---|
I was thinking about an example like:
import pygmt
fig = pygmt.Figure()
fig.coast(projection="N10c", region="g", frame=True, land="tan", water="lightblue")
fig.text(position="MC", text="PyGMT", font="60p,Helvetica-Bold,red@75")
fig.show()
I was thinking about an example like:
import pygmt fig = pygmt.Figure() fig.coast(projection="N10c", region="g", frame=True, land="tan", water="lightblue") fig.text(position="MC", text="PyGMT", font="60p,Helvetica-Bold,red@75") fig.show()
The text looks cool with the transparency effect :grinning:! 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. | working transparncy | NOT working transparency |
---|---|---|
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.
Maybe we can add additionally a note under the common-installation-issues section?
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.
import pygmt fig = pygmt.Figure() fig.coast(projection="H10c", region="g", frame=True, land="gray") fig.show()
Do we need a reminder in the release checklist regarding updating this warning before each release?
Makes sense to me.
@yvonnefroehlich Do you want to work on it?
import pygmt
fig = pygmt.Figure() fig.coast(projection="N10c", region="g", frame=True, land="tan", water="lightblue") fig.text(position="MC", text="PyGMT", font="60p,Helvetica-Bold,red@75") fig.show()
Maybe we can add additionally a note under the common-installation-issues section?
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.
import pygmt fig = pygmt.Figure() fig.coast(projection="H10c", region="g", frame=True, land="gray") fig.show()
Do we need a reminder in the release checklist regarding updating this warning before each release?
Makes sense to me.
@yvonnefroehlich Do you want to work on it?
Yes, I like to work on this. I just submitted PR #3249; will do the remain aspects in then next (hopefully two) days.
Description of the problem
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.pdfMy PyGMT version is 0.10.0.
Minimal Complete Verifiable Example
Full error message
System information