# Plotting shaded spheres

**URL:** <https://forum.generic-mapping-tools.org/t/plotting-shaded-spheres/6412>\
**Category:** Q&A\
**Tags:** gmt\
**Created:** [April 21, 2026, 10:33am UTC](https://forum.generic-mapping-tools.org/t/plotting-shaded-spheres/6412 "2026-04-21T10:33:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Faris\_hamza](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@Faris\_hamza](https://forum.generic-mapping-tools.org/u/Faris_hamza)\
**Post date:** [April 21, 2026, 10:33am UTC](https://forum.generic-mapping-tools.org/t/plotting-shaded-spheres/6412/1 "2026-04-21T10:33:38Z")

</div>

Hi,

How can I plot spheres with shaded colors, giving it a shadow effect on a 2D map.

---

<div class="post-metadata">

**Author:** ![PlanetGus](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/planetgus/32/303_2.png) [@PlanetGus](https://forum.generic-mapping-tools.org/u/PlanetGus)\
**Post date:** [April 21, 2026, 1:24pm UTC](https://forum.generic-mapping-tools.org/t/plotting-shaded-spheres/6412/2 "2026-04-21T13:24:56Z")

</div>

Like [this example](https://docs.generic-mapping-tools.org/latest/gallery/ex39.html) ?

---

<div class="post-metadata">

**Author:** ![Esteban82](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/esteban82/32/54_2.png) [@Esteban82](https://forum.generic-mapping-tools.org/u/Esteban82)\
**Post date:** [April 21, 2026, 5:14pm UTC](https://forum.generic-mapping-tools.org/t/plotting-shaded-spheres/6412/3 "2026-04-21T17:14:45Z")

</div>

Or something like this?

> <https://github.com/GenericMappingTools/gmt/pull/8844>
>
> They aren't really spheres but circles in 3D plots.
> 
> This is mostly a Claude.a…i creation but a one that needed a lot of baby-sitting development.
> 
> Claude picked -SQ for this option and I honestly couldn't think of a better alternative, though -Sq is a decorated line and -SQ has nothing to do with it. Ideas for a better syntax are welcome. The following is the summary prepared by Claude
> 
> \`\`\`
> 
> ● Summary of -SQ Sphere Symbol Option
> 
> Basic Syntax:
> -SQ\<size\>\[c|i|p\]\[+a\<azimuth\>\]\[+e\<elevation\>\]\[+f\]\[+n\]
> 
> Description:
> The -SQ option plots a 3-D sphere symbol with diameter \<size\>. The sphere is rendered with a radial gradient shading from white at the light source position to the fill color (specified by -G) at the opposite side, creating a realistic 3-D appearance.
> 
> Size Units:
> - Default unit: cm (centimeters)
> - Supported units: c (cm), i (inches), p (points)
> 
> Modifiers:
> - +a - Set light source azimuth angle \[default: 0°, from the right\]
> - +e - Set light source elevation angle \[default: 90°, perpendicular to viewing plane\]
> - +f - Use flat/constant fill color (disables gradient shading)
> - +n - Draw outline only with no fill
> 
> Fill and Outline:
> - Fill color: Specified by -G \[default: black if not specified\]
> - Outline: Controlled by -W (pen color, width, style)
> - Without -G and without +n, the sphere defaults to black fill
> \`\`\`
> 
> The \*\*+a\*\* and \*\*+e\*\* are not working correctly and I'm not even sure that we should have them. Opinions?
> 
> A low imagination example (used in the learning work) is:
> 
> \`\`\`
> echo 3 3 3 | gmt plot3d -R0/6/0/6/0/6 -JX10c -JZ4c -p135/45 -SQ2c -W0.2p,red -Ba -Bz -png lixo
> \`\`\`
> 
> \<img width="1750" height="1213" alt="lixo" src="https://github.com/user-attachments/assets/7d77cb7a-3587-439c-aed0-5a698b655a77" /\>
