MCPcopy Create free account
hub / github.com/GenericMappingTools/gmt / gmtplot_save_current_gridlines

Function gmtplot_save_current_gridlines

src/gmt_plot.c:1970–1980  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1968}
1969
1970GMT_LOCAL int gmtplot_save_current_gridlines (struct GMT_CTRL *GMT) {
1971 /* If only primary gridlines are drawn, we save information to gmt.history */
1972
1973 if (!(GMT->current.map.frame.axis[GMT_X].item[GMT_GRID_UPPER].active || GMT->current.map.frame.axis[GMT_Y].item[GMT_GRID_UPPER].active)) return (GMT_NOERROR); /* Primary gridlines not selected, so bail */
1974 if (GMT->current.map.frame.axis[GMT_X].item[GMT_GRID_LOWER].active || GMT->current.map.frame.axis[GMT_Y].item[GMT_GRID_LOWER].active) return (GMT_NOERROR); /* Secondary gridlines selected, so bail */
1975
1976 GMT->current.plot.gridline_spacing[GMT_X] = gmtlib_get_map_interval (GMT, GMT->current.map.frame.axis[GMT_X].type, &GMT->current.map.frame.axis[GMT_X].item[GMT_GRID_UPPER]);
1977 GMT->current.plot.gridline_spacing[GMT_Y] = gmtlib_get_map_interval (GMT, GMT->current.map.frame.axis[GMT_Y].type, &GMT->current.map.frame.axis[GMT_Y].item[GMT_GRID_UPPER]);
1978 GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "Save current gridline information to gmt.history\n");
1979 return (GMT_NOERROR);
1980}
1981
1982GMT_LOCAL int gmtplot_get_current_gridlines (struct GMT_CTRL *GMT, double *dx, double *dy) {
1983 /* Obtain the previous gridline intervals, if nonzero */

Callers 1

gmtplot_map_gridlinesFunction · 0.85

Calls 2

gmtlib_get_map_intervalFunction · 0.85
GMT_ReportFunction · 0.85

Tested by

no test coverage detected