GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow colorbar length and/or width to be given in percentages by PaulWessel · Pull Request #5775 · GenericMappingTools/gmt

Conversation

@PaulWessel

@PaulWessel PaulWessel commented Sep 17, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

If either of these are given in percentages then their values replace the default percentage values of 80% and 5% for length and width, respectively. I have added this information to the usage and documentation, and added a test script that tries various combination of percentages and actual dimensions:

gmt begin scale_percent ps
        gmt makecpt -Cturbo -T0/10
        gmt basemap -R0/10/0/10 -JX15c -B
        gmt colorbar -DJTC+w40%/15% -B
        gmt colorbar -DJML+w9c/5% -B
        gmt colorbar -DJMR+w80%/0.6c -B
        gmt colorbar -DJBC+w70% -B
gmt end show

which yields

scale_percent

Closes #5771.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
PaulWessel added 3 commits September 16, 2021 14:49
@PaulWessel
Allow colorbar length and/or width to be given in percentages
6295c04
If either of these has percentages then the value replace the default percentages values of 80% and 5% for length and width, respectively.
@PaulWessel
Update scale_percent.ps
b117bf4
@PaulWessel
WIP Allow colorbar dimensions to be given in percentages
8957882
This replaces the default values of 80% and 4% for length and width, respectively.
@PaulWessel PaulWessel self-assigned this Sep 17, 2021
@PaulWessel PaulWessel added the enhancement Improving an existing feature label Sep 17, 2021
@PaulWessel
Update gmt_io.c
d8896ba
@vercel
vercel Bot temporarily deployed to Preview September 17, 2021 01:13 Inactive
PaulWessel added 2 commits September 16, 2021 15:13
@PaulWessel
Update psscale.c
b11dcb8
@PaulWessel
Update psscale.c
e9c189b
@vercel
vercel Bot temporarily deployed to Preview September 17, 2021 01:20 Inactive
@PaulWessel
Update psscale.c
b8a8a7d
@vercel
vercel Bot temporarily deployed to Preview September 17, 2021 02:36 Inactive
@PaulWessel
PaulWessel requested review from Esteban82, joa-quim, maxrjones and seisman September 17, 2021 02:40
@Esteban82

Esteban82 commented Sep 17, 2021

Copy link
Copy Markdown
Member

I have a problem with gmt colorbar -DJML+w9c/5% -B

scale_percent

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Esteban82

Esteban82 commented Sep 17, 2021

Copy link
Copy Markdown
Member

I get the same width with 1% or 100%.

gmt begin scale_percent png
        gmt makecpt -Cturbo -T0/10
        gmt basemap -R0/10/0/10 -JX2/10c
        gmt colorbar -DjML+w9c/1% -B
        gmt colorbar -DjMR+w9c/100% -B
gmt end show

scale_percent

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 17, 2021

Copy link
Copy Markdown
Contributor Author

Strange that I dont get that. So it happens when the first (length) argument is a dimension and the second (width) is a percentage? Is that the only combination that fails?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Esteban82

Esteban82 commented Sep 17, 2021

Copy link
Copy Markdown
Member

Yes, only that combination.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel

PaulWessel commented Sep 17, 2021

Copy link
Copy Markdown
Contributor Author

I am testing anim08 on the tempfile_fix branch so it will take an hour before I can switch...

Esteban82 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel
Update psscale.c
2c660f8
@vercel
vercel Bot temporarily deployed to Preview September 17, 2021 06:37 Inactive
@PaulWessel

PaulWessel commented Sep 17, 2021

Copy link
Copy Markdown
Contributor Author

OK, should be better now - please try again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Esteban82
Esteban82 approved these changes Sep 17, 2021
View reviewed changes

@Esteban82 Esteban82 left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Now it works.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@maxrjones maxrjones added the add-changelog Add PR to the changelog label Sep 17, 2021
maxrjones
maxrjones approved these changes Sep 17, 2021
View reviewed changes

@maxrjones maxrjones left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Very nice!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/rst/source/colorbar.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@PaulWessel Meghan Jones
Update doc/rst/source/colorbar.rst
933fa02
Co-authored-by: Meghan Jones <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview September 17, 2021 18:32 Inactive
@PaulWessel
PaulWessel merged commit c2b5bae into master Sep 17, 2021
@PaulWessel
PaulWessel deleted the percent-handling branch September 17, 2021 18:33

This branch was previously deployed

1 inactive deployment
Preview — 933fa02f Deployed Sep 17, 2021 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@maxrjones maxrjones maxrjones approved these changes
@Esteban82 Esteban82 Esteban82 approved these changes
@joa-quim joa-quim Awaiting requested review from joa-quim
@seisman seisman Awaiting requested review from seisman

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@PaulWessel PaulWessel

Labels

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

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

colorbar length as a percentage relative to a map side

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@PaulWessel @Esteban82 @maxrjones
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.