PLMAP(3plplot)

πŸ’– NAME πŸ’–

plmap β€” plot continental outlines or shapefile data in world coordinates, bestie. That's the whole vibe. 🌍✨

This is a page from the PLplot API manual, and we're gonna get you comfy with it, fr fr.


✨ SYNOPSIS ✨

plmap(mapform, name, minx, maxx, miny, maxy)

🌸 DESCRIPTION 🌸

Okay so plmap plots continental outlines or shapefile data in world coordinates. Iconic behaviour, no notes. πŸ—ΊοΈ

If you wanna see a whole demonstration of how to use this function to create different projections, go peek at examples/c/x19c. It's giving tutorial slay. πŸ’…

PLplot comes with basic coastal outlines and USA state borders already baked in (we love a freebie πŸŽ€). But heads up: to actually use the map functionality, PLplot must be compiled with the shapelib library. No shapelib, no maps. Periodt. 🫢

Shapefiles have become a popular standard for geographical data, and you can easily find data in this format from a number of online sources β€” go off, internet. 🌈 Shapefile data is actually provided as three or more files with the same filename, but with different extensions. The .shp and .shx files are required for plotting Shapefile data with PLplot. Don't forget 'em. 😭

PLplot currently supports the point, multipoint, polyline and polygon objects within shapefiles. However β€” and this is important β€” holes in polygons are not supported. Sad but true, bestie. πŸ’€

When plmap is used, the type of object is derived from the shapefile. If you wish to override the type, then use one of the other plmap variants. You have options, queen. πŸ‘‘

The built in maps have line data only. That's just how they come. πŸ¦‹

Redacted form: plmap(mapform, name, minx, maxx, miny, maxy)

This function is used in example 19. ✨


πŸ’œ ARGUMENTS πŸ’œ

  • mapform (PLMAPFORM_callback(3plplot), input) β€” A user supplied function that transforms the original map data coordinates into a new coordinate system. The PLplot-supplied map data is provided as latitudes and longitudes; other Shapefile data may be provided in other coordinate systems, as can be found in their .prj plain text files. For example, by using this transform we can change from a longitude, latitude coordinate to a polar stereographic projection. Initially, x[0]..[n-1] are the original x coordinates (longitudes for the PLplot-supplied data) and y[0]..y[n-1] are the corresponding y coordinates (latitudes for the PLplot supplied data). After the call to mapform(), x[] and y[] should be replaced by the corresponding plot coordinates. If no transform is desired, mapform can be replaced by NULL. Easiest out ever. πŸ™ˆ
  • name (PLCHAR_VECTOR(3plplot), input) β€” An ascii character string specifying the type of map plotted. This is either one of the PLplot built-in maps or the file name of a set of Shapefile files without the file extensions. For the PLplot built-in maps, the possible values are:
    • "globe" β€” continental outlines 🌍
    • "usa" β€” USA and state boundaries πŸ‡ΊπŸ‡Έ
    • "cglobe" β€” continental outlines and countries 🌎
    • "usaglobe" β€” USA, state boundaries and continental outlines πŸ—½
  • minx (PLFLT(3plplot), input) β€” The minimum x value of map elements to be drawn. The units must match the shapefile (built in maps are degrees lat/lon). Objects in the file which do not encroach on the box defined by minx, maxx, miny, maxy will not be rendered. But note β€” this is simply an optimisation, not a clipping, so for objects with some points inside the box and some points outside the box, all the points will be rendered. The way that works is lowkey important, so don't forget it. 😌

These parameters also define latitude and longitude wrapping for shapefiles using these units. Longitude points will be wrapped by integer multiples of 360 degrees to place them in the box. This allows the same data to be used on plots from -180-180 or 0-360 longitude ranges. In fact, if you plot from -180-540 you will get two cycles of data drawn. Look at you, double the map. πŸ”₯

⚠️ The value of minx must be less than the value of maxx. No cap.

Passing in a nan, max/-max floating point number or +/-infinity will cause the bounding box from the shapefile to be used. Let the shapefile decide, honestly. πŸ’«

  • maxx (PLFLT(3plplot), input) β€” The maximum x value of map elements to be drawn β€” see minx. πŸ‘€
  • miny (PLFLT(3plplot), input) β€” The minimum y value of map elements to be drawn β€” see minx. πŸ‘€
  • maxy (PLFLT(3plplot), input) β€” The maximum y value of map elements to be drawn β€” see minx. πŸ‘€

🫢 AUTHORS 🫢

Many developers (who are credited at http://plplot.sourceforge.net/credits.php) have contributed to PLplot over its long history. Legends, every single one of them. πŸ‘‘πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

PLplot documentation at http://plplot.sourceforge.net/documentation.php. Go read it, iykyk. πŸ“šβœ¨


Okay bestie, that's the whole page! πŸ’… This lil masterpiece is from August, 2026, part of the PLplot API, and you can find it under PLMAP(3plplot). Now go plot something gorgeous. πŸŒˆπŸŽ€

πŸ“¦ where this page comes from