Skip to content

gmt subplot frames not displayed correctly #7734

@VinceS97403

Description

@VinceS97403

Description of the problem

Hello, I am trying to plot two maps of Alaska using subplot 1x2. The frames produced by this command do not alternate the black and white stripes consistently. On each axis one stripe is black or white and the rest is the other color. Please let me know if this is not clear enough.

Full script that generated the error

#!/usr/bin/env bash
#gmt set  HEADER_FONT_SIZE 14p
gmt set GMT_THEME cookbook
#gmt set LABEL_OFFSET 0.2c

# Color palettes
gmt makecpt -Cmyearth_mag.cpt #-Cpolar > mag_pol.cpt #-T-500/-250/0/250/500 > mag.cpt
gmt makecpt -Cmod_jolla.cpt #coupling.cpt
gmt makecpt -Cmod_rom.cpt #/Users/vsassard/Desktop/Codes/ScientificColourMaps8/hawaii/hawaii.cpt earthquake_loc_USGS_copy.txt -D -T0/200/20 > mod_haw.cpt
gmt makecpt -Cmod_rom_slab.cpt

# Variables
gmt begin Tectonic_setting_AK
        gmt subplot begin 1x2 -Fs6i -R-165.5/-147/51/61 -JB-156/56/50/60/6i -Bxa4f30 -Bya2f30 -BWNes -Sr+t #-B+t'Tectonic Setting of the Alaska Subduction Zone'
                gmt subplot set

                # Crop the magnetic anomalies in a subregion
                gmt grdcut @earth_mag_02m_p -GMag_AK.grd -FAK_cut.txt+c
                # Plot the magnetic anomalies subset
                gmt grdimage Mag_Ak.grd -Cmyearth_mag.cpt

                # Plot the coastline and fill it in gray
                gmt coast -Df -Ggray -W #-B+s'Seismicity and Structural Variations Along-Strike'

                # Trench        
                gmt plot Trench_AK.txt -i0,1 -W1 -Sf0.3/4p+t+r -Gblack

                # Slab contours
                gmt plot alu_contours.in -Cmod_rom_slab.cpt -W1.25

                # Ruptures
                gmt plot 1946eq.xy -W2
                gmt plot 1948eq.xy -W2
                gmt plot 1964eq.xy -W2
                gmt plot simeonofslip_1m -W2
                gmt plot chignikslip_1m -W2
                gmt plot 1938slip_1m -W2
                gmt plot 1946eq.xy -W2

                # Volcanoes
                gmt plot AKvolcanoes.csv -i1,0 -h1 -St0.5 -W1 -Gred

                # Earthquakes
                gmt plot earthquake_loc_USGS_copy.txt -i2,1,3 -h10 -Sc0.2 -G+z -Cmod_rom.cpt

                # Legend 
#               gmt colorbar -Bxa40f25+l"Depth (km)" -By -Cmod_rom.cpt -DJBC
                #gmt legend


                gmt subplot set

        # Crop the magnetic anomalies in a subregion
#        gmt grdcut @earth_mag_02m_p -GMag_AK.grd -FAK_cut.txt+c
        # Plot the magnetic anomalies subset
#       gmt grdimage -R-166.5/-146/51/61 -JB-156/56/50/60/10i Mag_Ak.grd -Cmyearth_mag.cpt

                # Plot the coastline and fill it in gray
                gmt coast -Df -Ggray -W #-B+s'Seismicity and Structural Variations Along-Strike'

                # Trench        
                gmt plot Trench_AK.txt -i0,1 -W1 -Sf0.3/4p+t+r -Gblack

                # Slab contours
                gmt plot alu_contours.in -Cmod_rom_slab.cpt -W1.25

                # Locking fraction
                gmt plot gaussian_simeonof_slip_bkp -Cmod_jolla.cpt -G+z -t30 #-O -P -L -V -K #>> chig_intro.ps

                # Ruptures
                gmt plot 1946eq.xy -W2
                gmt plot 1948eq.xy -W2
                gmt plot 1964eq.xy -W2
                gmt plot simeonofslip_1m -W2
                gmt plot chignikslip_1m -W2
                gmt plot 1938slip_1m -W2

                # Volcanoes
                gmt plot AKvolcanoes.csv -i1,0 -h1 -St0.5 -W1 -Gred

                # Stations
                gmt plot AK_stations.csv -i1,0 -h1 -Sc0.25 -W1,white -Gpurple

#               gmt colorbar -Bxa40f25+l"Depth (km)" -By -Cmod_rom.cpt -DJBC
#               gmt set MAP_LABEL_OFFSET 15p
                gmt colorbar -Bx -Bya0.2f30+l"Locking fraction" -Cmod_jolla.cpt -DJMR
        gmt subplot end
        gmt colorbar -Bxa40f25+l"Depth (km)" -By -Cmod_rom.cpt -DJBC
gmt end show

Full error message

No error message

Actual outcome

image

Expected outcome
This is what I got when not using subplot
image

System information

  • Operating system: macOS Ventura 13.5
  • GMT version (gmt --version): 6.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions