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 — Multiple line titles and subtitles · Issue #97 · riatelab/mapsf

Multiple line titles and subtitles #97

New issue
Copy link
New issue
Copy link
Open
Open
Multiple line titles and subtitles#97
Copy link
Labels
enhancementNew feature or request

Description

@ElinaMX
ElinaMX
opened on Aug 28, 2026
Issue body actions

Is it possible to add a "subtitle" argument to the mf_layout() function so the subtitle text would get under the title without moving it up, out of the plot box, and with an other font.

For now i use the "\n" escape character but it's behaviour is tricky and I need to adjust differents sizes in the themes options

library(mapsf)
# Import the sample dataset
mtq <- mf_get_mtq()
# change theme
mf_theme(x="sol_dark")
# Plot the base map
mf_map(x = mtq)
# Plot proportional symbols
mf_map(x = mtq, var = "POP", type = "prop", leg_pos = "topright")
# Plot a map layout
mf_layout(
  title = "Population in Martinique\nCeci est un sous-titre
  ",
  credits = "T. Giraud; Sources: INSEE & IGN, 2018"
)
Image

With margins and title line tweeking

library(mapsf)
# Import the sample dataset
mtq <- mf_get_mtq()
# change theme
mf_theme(x="sol_dark", title_line = 4, mar = c(1, 1, 4, 1))
# Plot the base map
mf_map(x = mtq)
# Plot proportional symbols
mf_map(x = mtq, var = "POP", type = "prop", leg_pos = "topright")
# Plot a map layout
mf_layout(
  title = "Population in Martinique\nCeci est un sous-titre",
  credits = "T. Giraud; Sources: INSEE & IGN, 2018"
)
Image

Thank you !

Activity

  1. rCarto commented on Sep 1, 2026

    @rCarto
    rCarto
    on Sep 1, 2026
    Member
    More actions

    That's a good idea. I'll do something about it soon. Meanwhile you can also use mf_text() (inside the plot box, though).

    library(mapsf)
    m <- mf_get_mtq()
    mf_map(m)
    mf_title("Main title, in the title zone", pos = "left")
    mf_text(x = "topleft", txt = "Sub-title, in the map zone", 
            cex = 1, font = 2, adj = c(0, 1))
    mf_arrow(pos = "topleft", adj = c(0, -4))
    mf_frame(extent = "map")

    Or you can use 2 mf_tite() calls (inside the title area, but not easy to use various title sizes + theme tweaks):

    library(mapsf)
    mf_theme(x="sol_dark", title_line = 3.5, mar = c(.5, .5, 4, .5))
    m <- mf_get_mtq()
    mf_map(m)
    mf_title("First Title\n", font = 2, banner = F)
    mf_title("\nSecond Title", font = 3, bg = NA, fg = "red")

  2. rCarto
    pinned and unpinned a comment on Sep 1, 2026
  3. rCarto
    added
    enhancementNew feature or request
    on Sep 1, 2026
  4. rCarto commented on Nov 9, 2026

    @rCarto
    rCarto
    on Nov 9, 2026
    Member
    More actions

    In current dev version it is possible to display a title and a subtitle with a combination of mf_theme() parameters and mf_text() calls with xpd = TRUE.

    library(mapsf)
    mtq <- mf_get_mtq()
    mf_theme("sol_dark", mar = c(0, 0, 3, 0), title_line = 3)
    mf_map(mtq)
    mf_text(x = "topleft", txt = "Main Title", adj = c(0, 11), cex = 1.5, font = 2, xpd = TRUE)
    mf_text(x = "topleft", txt = "Sub Title", adj = c(0, 5), cex = 1, xpd = TRUE)

    Created on 2026-11-09 with reprex v2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — 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.