Skip to content

Psxy error when specifying "landscape" orientation with gmtset #1175

@Malley1

Description

@Malley1

Description of the problem

Hi,

I am running gmt6.0.0. I found an error in psxy while drawing lines or polygons - when PS_PAGE_ORIENTATION is set to landscape, strange vertical lines appear on the plot. See attached examples which only differ by gmt gmtset PS_PAGE_ORIENTATION = portrait vs. PS_PAGE_ORIENTATION = landscape. I am aware that the "convert" line also contains a "-rotate 90" flag which is why the images aren't actually appearing in portrait or landscape respectively but that's not the issue.

#!/bin/bash
source /home/co323/.bashrc

gmt gmtset PS_PAGE_ORIENTATION = landscape

testno="35"
outputstring="output_8"

psfile="./timeslice_plots/all_africa_drainage_blt${testno}_${outputstring}_landscape.ps"

drainagedir="/space/co323/landscape_evolution/badlands/inversions/blt${testno}/${outputstring}/data/raw_data"
basins=`ls $drainagedir`

rgn="-R-24/64/-39/44"
proj="-JM12c"

coast1="/space/co323/afr_arab_mad_riv_inv/plotting/coast_full_afr_mad.dat"
d=">"

gmt psbasemap $rgn $proj -Ba0 -K > $psfile

datadir="riv_data_blt${testno}_${outputstring}"
riverlist=`ls $datadir`

coast1="/space/co323/afr_arab_mad_riv_inv/plotting/coast_full_afr_mad.dat"
d=">"
awk -v d=$d '{if (NF==2) print ($1*1000)-5e6, ($2*1000)-5e6 ; else print d}' $coast1 | invproj +proj=aea +lon_0=25e +lat_0=0 +lat_1=23s +lat_2=20n +datum=WGS84 +units=m +no_defs +to +proj=latlon -f '%.8f' | awk -v d=$d '{if ($1 != "25.00000000" && $2 != "-0.00000000>") print $1, $2 ; else print d}' > coastfile_ll.temp

gmt psclip coastfile_ll.temp $rgn $proj -O -K >> $psfile

echo "plotting all_ll_blt${testno}_${outputstring}.txt..."
gmt psxy all_ll_blt${testno}_${outputstring}.txt $rgn $proj -W0.5p,blue -O -K >> $psfile

gmt psclip -C $rgn $proj -O -K >> $psfile

gmt pscoast -Dh -W1p,black -A6000/0/0 -O -K $rgn $proj >> $psfile 


ps2jpg

eog $jpgfile &

ps2jpg is:

ps2jpg () {
	if [ $# -eq 1 ] ; then
		psfile="$1"
	fi
	jpgfile=$(echo $psfile | sed s/"\.ps"/".jpg"/)

	convert -density 300 -quality 100 -rotate 90 -trim -matte -bordercolor white -border 5x5 $psfile $jpgfile
}

all_africa_drainage_blt35_output_8_landscape

The following plot differs only in that the gmtset line now reads:

gmt gmtset PS_PAGE_ORIENTATION = portrait

all_africa_drainage_blt35_output_8_portrait

(No error message)

System information

  • Operating system: ubuntu 16.04 LTS
  • Version of GMT: 6.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions