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

doc: Combine the modern and classic documention of image/psimage into a single file #8487

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 doc/rst/source/gmtlogo-classic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ See Also
--------

:doc:`gmt`, :doc:`pslegend`,
:doc:`psimage`, :doc:`psscale`, :doc:`psxy`
:doc:`psimage <image>`, :doc:`psscale`, :doc:`psxy`
93 changes: 68 additions & 25 deletions doc/rst/source/image.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.. index:: ! image
.. index:: ! psimage
.. include:: module_core_purpose.rst_

*****
Expand All @@ -7,6 +8,10 @@ image

|image_purpose|

.. note::

The module name is **psimage** in GMT classic mode.

Synopsis
--------

Expand All @@ -20,7 +25,10 @@ Synopsis
[ |-I| ]
[ |-J|\ *parameters* ]
[ |-J|\ **z**\|\ **Z**\ *parameters* ]
[ |-K| ]
[ |-M| ]
[ |-O| ]
[ |-P| ]
[ |SYN_OPT-Rz| ]
[ |SYN_OPT-U| ]
[ |SYN_OPT-V| ]
Expand All @@ -30,8 +38,6 @@ Synopsis
[ |SYN_OPT-t| ]
[ |SYN_OPT--| ]

.. module_common_begins

Description
-----------

Expand Down Expand Up @@ -78,7 +84,7 @@ Optional Arguments
**Note**: If **-Dj** is used then *justify* defaults to the same as *refpoint*,
if **-DJ** is used then *justify* defaults to the mirror opposite of *refpoint*.
Specify image size in one of two ways:

- **+n** - Append \ *nx*\ [/*ny*] to replicate the (scaled) image *nx* times horizontally and
*ny* times vertically. If *ny* is omitted, it will be identical to *nx* [Default is 1/1].
- **+r** - Specify *dpi* to set the dpi of the image in dots per inch, or append **c**
Expand Down Expand Up @@ -161,50 +167,87 @@ Optional Arguments

.. include:: explain_help.rst_

.. include:: common_classic.rst_

Notes
-----

The |-G| and |-I| options are for raster images only. They have
no effect when placing Encapsulated *PostScript* files.

.. module_common_ends

Examples
--------

.. include:: oneliner_info.rst_
.. tab-set::

.. tab-item:: GMT modern mode
:sync: modern

.. include:: oneliner_info.rst_

To plot the remote image needle.jpg, scaling it be 7 cm wide (height is scaled
accordingly), use::

gmt image @needle.jpg -Dx0/0+w7c -pdf plot

To plot the same file but reversing the bands, use::

gmt image @needle.jpg+b2,1,0 -Dx0/0+w7c -pdf plot

To only plot its red band as gray shade, use::

gmt image @needle.jpg+b0 -Dx0/0+w7c -pdf plot

To include an Encapsulated PostScript file gallo.eps with its upper
right corner 2 inch to the right and 1 inch up from the current
location, and have its width scaled to 3 inches, while keeping the
aspect ratio, use::

gmt image @gallo.eps -Dx2i/1i+jTR+w3i -pdf image

To replicate the 1-bit remote raster image vader1.png, colorize it
(dark gray background and yellow foreground), and setting each of 6 by 12 tiles
to be 2.5 cm wide, use::

gmt image @vader1.png -Gdarkgray+b -Gyellow+f -Dx0/0+w2.5c+n6/12 -pdf image

.. tab-item:: GMT classic mode
:sync: classic

To plot the remote image needle.jpg, scaling it be 7 cm wide (height is scaled
accordingly), use::
To plot the remote image needle.jpg, scaling it be 7 cm wide (height is scaled
accordingly), use::

gmt image @needle.jpg -Dx0/0+w7c -pdf plot
gmt psimage @needle.jpg -Dx0/0+w7c > image.ps

To plot the same file but reversing the bands, use::
To plot the same file but reversing the bands, use::

gmt image @needle.jpg+b2,1,0 -Dx0/0+w7c -pdf plot
gmt psimage @needle.jpg+b2,1,0 -Dx0/0+w7c > image.ps

To only plot its red band as gray shade, use::
To only plot its red band as gray shade, use::

gmt image @needle.jpg+b0 -Dx0/0+w7c -pdf plot
gmt psimage @needle.jpg+b0 -Dx0/0+w7c > image.ps

To include an Encapsulated PostScript file gallo.eps with its upper
right corner 2 inch to the right and 1 inch up from the current
location, and have its width scaled to 3 inches, while keeping the
aspect ratio, use::
To include an Encapsulated PostScript file gallo.eps with its upper
right corner 2 inch to the right and 1 inch up from the current
location, and have its width scaled to 3 inches, while keeping the
aspect ratio, use::

gmt image @gallo.eps -Dx2i/1i+jTR+w3i -pdf image
gmt psimage @gallo.eps -Dx2i/1i+jTR+w3i > image.ps

To replicate the 1-bit remote raster image vader1.png, colorize it
(dark gray background and yellow foreground), and setting each of 6 by 12 tiles
to be 2.5 cm wide, use::
To replicate the 1-bit remote raster image vader1.png, colorize it
(dark gray background and yellow foreground), and setting each of 6 by 12 tiles
to be 2.5 cm wide, use::

gmt image @vader1.png -Gdarkgray+b -Gyellow+f -Dx0/0+w2.5c+n6/12 -pdf image
gmt psimage @vader1.png -Gdarkgray+b -Gyellow+f -Dx0/0+w2.5c+n6/12 -P > image.ps

See Also
--------

:doc:`gmt`,
:doc:`gmtcolors`, :doc:`gmtlogo`
:doc:`legend`, :doc:`colorbar`
:doc:`gmtcolors`, :doc:`gmtlogo`,
:doc:`legend`, :doc:`colorbar`,
:doc:`plot`,
:doc:`psconvert`
:doc:`psconvert`,
:doc:`pslegend <legend>`,
:doc:`psscale <colorbar>`,
:doc:`psxy <plot>`
6 changes: 3 additions & 3 deletions doc/rst/source/modules-classic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ All modules are requested via a call to the :doc:`gmt` program.
psconvert
psevents
pshistogram
psimage
psimage <image>
pslegend
psmask
psrose
Expand Down Expand Up @@ -265,7 +265,7 @@ Core Modules
- :doc:`psconvert`
- :doc:`psevents`
- :doc:`pshistogram`
- :doc:`psimage`
- :doc:`psimage <image>`
- :doc:`pslegend`
- :doc:`psmask`
- :doc:`psrose`
Expand Down Expand Up @@ -397,7 +397,7 @@ Plotting
+-------------------------------+-----------------------+
| :doc:`pshistogram` | |pshistogram_purpose| |
+-------------------------------+-----------------------+
| :doc:`psimage` | |psimage_purpose| |
| :doc:`psimage <image>` | |psimage_purpose| |
+-------------------------------+-----------------------+
| :doc:`pslegend` | |pslegend_purpose| |
+-------------------------------+-----------------------+
Expand Down
76 changes: 0 additions & 76 deletions doc/rst/source/psimage.rst

This file was deleted.

2 changes: 1 addition & 1 deletion doc/rst/source/psscale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ See Also

:doc:`gmt`, :doc:`makecpt`
:doc:`gmtlogo`, :doc:`grd2cpt`
:doc:`psimage`, :doc:`pslegend`
:doc:`psimage <image>`, :doc:`pslegend`