Skip to content

Let map roses have a default size of 10% of map width#6212

Merged
PaulWessel merged 4 commits intorose-adjustmentfrom
def-rose-size
Jan 12, 2022
Merged

Let map roses have a default size of 10% of map width#6212
PaulWessel merged 4 commits intorose-adjustmentfrom
def-rose-size

Conversation

@PaulWessel
Copy link
Member

This PR makes +wwidth optional for magnetic and directional roses. if not given we default to 10% of the map width. Alternatively, give +w with % as unit to change this value. Closes #6211.

@Esteban82, please test this a bit, also for magnetic rose (see GMT_App_K_3.sh or GMT_mag_rose.sh for examples). if you think 10% is too small for the magnetic rose let me know - we can always have a different default there.

This PR makes +wwidth optional for magnetic and directional roses.  if not given we default to 10% of the map width. Alternatively, give +w with % as unit to change this value.  Closes #6211
@PaulWessel PaulWessel added the enhancement Improving an existing feature label Jan 11, 2022
@PaulWessel PaulWessel added this to the 6.4.0 milestone Jan 11, 2022
@PaulWessel PaulWessel requested a review from Esteban82 January 11, 2022 20:22
@PaulWessel PaulWessel self-assigned this Jan 11, 2022
@PaulWessel
Copy link
Member Author

Note this bug/feature which is separate from this PR:

gmt coast -RGB+r2 -JM20c -Gred -B -pdf map -TdjTR+l

We do not adjust the offset when the N label is requested. I will fix this in another PR I think.

@PaulWessel
Copy link
Member Author

Same/worse if I add +f for fancy.

@Esteban82
Copy link
Member

Here I test the sizes of roses.
Directional roses goes from 5% to 10% (with 1% inc).
Magnetic roses: 10%, 12.5%, 15%, 17.5% and 20% (2.5 % inc).

Now I think we could use 8% for directional and 15% for magnetic.

test_autoN

Copy link
Member

@Esteban82 Esteban82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works. We should define the default values.

@PaulWessel
Copy link
Member Author

OK, done. I hope you based your suggestion on the symbols and not the text since another PR will fix the too-large font sizes.

@Esteban82
Copy link
Member

I do it based on the spacing of the tickmarks.

BTW what do you think in similar feature for the scale bar ? I.e to have a default length (and unit).

@PaulWessel PaulWessel changed the title Let map roses have a default size of 10% of map width WIP Let map roses have a default size of 10% of map width Jan 11, 2022
@PaulWessel
Copy link
Member Author

I think we will wait merging this branch until the auto-font size/offset is done. Then we can revisit those percentages.

Sure, you can open a feature request for that.

@PaulWessel
Copy link
Member Author

Sorry, could you share your script above so I can use it to test font sizes etc?

@Esteban82
Copy link
Member

Sorry, could you share your script above so I can use it to test font sizes etc?

gmt begin test_autoN png
	gmt coast -Df -N1/thinnest -N2/thinnest,- -W1/thinnest -R-72/-51/-62/-53.5 -JM15c -Bxaf -Byaf 

#	Directional Rose
	gmt basemap -TdjTR+w10%+f
	gmt basemap -TdjTR+w9%+o2c/0+f
	gmt basemap -TdjTR+w8%+o4c/0+f
	gmt basemap -TdjTR+w7%+o6c/0+f
	gmt basemap -TdjTR+w6%+o8c/0+f
	gmt basemap -TdjTR+w5%+o10c/0+f
	
#	Margnetic Rose	
	gmt basemap -TmjBR+w20%
	gmt basemap -TmjBR+w17.5%+o3c/0
	gmt basemap -TmjBR+w15%+o6c/0
	gmt basemap -TmjBR+w12.5%+o9c/0
	gmt basemap -TmjBR+w10%+o12c/0
gmt end

@PaulWessel PaulWessel changed the base branch from master to rose-adjustment January 12, 2022 02:38
@PaulWessel PaulWessel changed the title WIP Let map roses have a default size of 10% of map width Let map roses have a default size of 10% of map width Jan 12, 2022
@PaulWessel
Copy link
Member Author

FYI @Esteban82 I decided to merge this branch into the one doing the justification since I kind of want to see how both work together.

@PaulWessel PaulWessel merged commit 4188b3b into rose-adjustment Jan 12, 2022
@PaulWessel PaulWessel deleted the def-rose-size branch January 12, 2022 02:42
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Jan 25, 2022
PaulWessel added a commit that referenced this pull request Feb 3, 2022
* Correct rose position for label size

Also, for modern mode reset the text font and offset based on symbol size.

* Do alignment in PSL

Also add test script dir_roses.sh

* more documentation

* Update gmt_plot.c

* Update gmt_plot.c

* Update gmt_plot.c

* Let map roses have a default size of 10% of map width (#6212)

* Let map roses have a default size of 10% of map width

This PR makes +wwidth optional for magnetic and directional roses.  if not given we default to 10% of the map width. Alternatively, give +w with % as unit to change this value.  Closes #6211

* Set 15 and 8 % as default sizes

* Select 20% and 40% for size/offset

* Set adjusting for mag compass

* Update gmt_plot.c

* Add MAP_EMBELLISHMENT_MODE

* Add position adjustment for mag rose too

* Update gmt_plot.c

* Use manual mode for old scripts

* Auto offset if not set

* Name changes

* Exact justification and margins for -Td plain

* Minor script updates

* comments and larger symbol

* Update gmt_plot.c

* Name another constant

* Restore size of rose

* Update GMT_obl_nz.sh

* Clean up script

* Update gmt_plot.c

Comment out a debug section

* Update gmt_plot.c

* Update explain_-T_rose.rst_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

add-changelog Add PR to the changelog enhancement Improving an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set width for map roses (-Td) with % values and make it optional

3 participants