Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pygmt/src/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def plot(self, x=None, y=None, data=None, size=None, direction=None, **kwargs):
{p}
{t}
*transparency* can also be a 1d array to set varying transparency
for symbols.
for symbols, but this option is only valid if using x/y.
"""
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access

Expand Down
2 changes: 1 addition & 1 deletion pygmt/src/plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def plot3d(
{p}
{t}
*transparency* can also be a 1d array to set varying transparency
for symbols.
for symbols, but this option is only valid if using x/y/z.
"""
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access

Expand Down
2 changes: 2 additions & 0 deletions pygmt/src/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ def text_(
{f}
{p}
{t}
*transparency* can also be a 1d array to set varying transparency
for texts, but this option is only valid if using x/y/text.
"""

# pylint: disable=too-many-locals
Expand Down
8 changes: 5 additions & 3 deletions pygmt/tests/test_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ def test_plot_fail_no_data(data):
)


def test_plot_fail_color_size_intensity(data):
def test_plot_fail_1d_array_with_data(data):
"""
Should raise an exception if array color, size and intensity are used with
matrix.
Should raise an exception if array color, size, intensity and transparency
are used with matrix.
"""
fig = Figure()
kwargs = dict(data=data, region=region, projection="X10c", frame="afg")
Expand All @@ -104,6 +104,8 @@ def test_plot_fail_color_size_intensity(data):
fig.plot(style="cc", size=data[:, 2], color="red", **kwargs)
with pytest.raises(GMTInvalidInput):
fig.plot(style="c0.2c", color="red", intensity=data[:, 2], **kwargs)
with pytest.raises(GMTInvalidInput):
fig.plot(style="c0.2c", color="red", transparency=data[:, 2] * 100, **kwargs)


@pytest.mark.mpl_image_compare
Expand Down
8 changes: 5 additions & 3 deletions pygmt/tests/test_plot3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ def test_plot3d_fail_no_data(data, region):
)


def test_plot3d_fail_color_size_intensity(data, region):
def test_plot3d_fail_1d_array_with_data(data, region):
"""
Should raise an exception if array color, size and intensity are used with
matrix.
Should raise an exception if array color, size, intensity and transparency
are used with matrix.
"""
fig = Figure()
kwargs = dict(data=data, region=region, projection="X10c", frame="afg")
Expand All @@ -121,6 +121,8 @@ def test_plot3d_fail_color_size_intensity(data, region):
fig.plot3d(style="cc", size=data[:, 2], color="red", **kwargs)
with pytest.raises(GMTInvalidInput):
fig.plot3d(style="cc", intensity=data[:, 2], color="red", **kwargs)
with pytest.raises(GMTInvalidInput):
fig.plot3d(style="cc", color="red", transparency=data[:, 2] * 100, **kwargs)


@pytest.mark.mpl_image_compare
Expand Down