# Help needed: legend problem in GMT6.1, Windows 10

**URL:** <https://forum.generic-mapping-tools.org/t/help-needed-legend-problem-in-gmt6-1-windows-10/677>\
**Category:** Q&A\
**Created:** [July 17, 2020, 5:57pm UTC](https://forum.generic-mapping-tools.org/t/help-needed-legend-problem-in-gmt6-1-windows-10/677 "2020-07-17T17:57:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![richannan](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@richannan](https://forum.generic-mapping-tools.org/u/richannan)\
**Post date:** [July 17, 2020, 5:57pm UTC](https://forum.generic-mapping-tools.org/t/help-needed-legend-problem-in-gmt6-1-windows-10/677/1 "2020-07-17T17:57:14Z")

</div>

Hello friends, I started using GMT early this year. I want to put this across concerning getting a legend on a map. I followed Examples 42 and 49. The legend does not plot if I pass the legend content in the script. It reports this error message: “\<\< was unexpected at this time”

However, the line below works if I use a file that contains the legend content:  
gmt legend -DjLB+w1.7i/0.9i+o0.15i/0.13i -F+gwhite+p1p+c0.1c study\_area\_map\_legend.txt

Is there a way around it so that it plots like in Examples 42 and 49? Below is the script I have:

```auto
 gmt begin study_area_map png

	:: Making some settings:
	gmt set FONT_ANNOT_PRIMARY 8p,Helvetica FONT_LABEL 10p MAP_ANNOT_OFFSET_PRIMARY 0.1c FONT_TITLE 10p MAP_TITLE_OFFSET 0.1c
	
	:: Plotting the main map:
	gmt coast -R-155/62/-60/60 -JM6i -Wfaint -N1/0.2p -EGH,CG,CI,BJ,GA,GN,GQ,CM,GW,LR,NG,ST,SL,TG+gdarkbrown -Gbisque -Sazure1 -Da -Bpx60 -Bpy30 -BWSne -Lg25/-55+c30N+w5000k+f+l+ar -Td35/-42+w1.5c+l+f3
	gmt plot Depths.csv -Sc0.02c -Gblack 
	
	:: Plotting an inset:
	gmt inset begin -DjLT+w3.5i/2.8i+o0.15i/0.1i -F+gwhite+p1p+c0.1c+s
		gmt set MAP_ANNOT_OFFSET_PRIMARY -0.1c		
		gmt coast -R-17/6/-6/12 -JM? -Wfaint -N1/0.1p -EGH,CI,BJ,GN,GW,LR,NG,ST,SL,TG+gdarkbrown -Gbisque -Sazure1 -Df -Bag -BWSne
		gmt plot Depths.csv -Sc0.03c -Gblack				
	gmt inset end
	
	:: Plotting the legend:
	gmt legend -DjLB+w1.7i/0.9i+o0.15i/0.13i -F+gwhite+p1p+c0.1c << EOF (fails to plot)	
	H 10p,Helvetica Legend
	S 0.15i c 0.1i black 0.25p 0.3i Depth point
	S 0.15i - 0.2i black 0.45p 0.3i National boundary
	S 0.15i s 0.2i azure1 0.25p 0.3i Ocean
	S 0.15i s 0.2i bisque 0.25p 0.3i Continent
 	S 0.15i s 0.2i darkbrown 0.25p 0.3i Countries of interest
	EOF
	
gmt end show

```

Sorry for the long post.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [July 17, 2020, 9:13pm UTC](https://forum.generic-mapping-tools.org/t/help-needed-legend-problem-in-gmt6-1-windows-10/677/2 "2020-07-17T21:13:07Z")

</div>

I am unaware that :: is an allowable comment in a bash script? Perhaps you are not using bash but some other script in which the “here document” notion of \<\< marker is not supported? As far as I know, “here document” is not supported in windows batch scripts.

---

<div class="post-metadata">

**Author:** ![richannan](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@richannan](https://forum.generic-mapping-tools.org/u/richannan)\
**Post date:** [July 17, 2020, 9:37pm UTC](https://forum.generic-mapping-tools.org/t/help-needed-legend-problem-in-gmt6-1-windows-10/677/3 "2020-07-17T21:37:49Z")

</div>

Thank you very much @pwessel for the clarification. You’re right I’m not using bash. I’m using a batch script. Now I know for sure \<\< doesn’t work in batch scripts.
