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

Function gmtplot_lineary_grid

src/gmt_plot.c:758–783  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

756}
757
758GMT_LOCAL void gmtplot_lineary_grid (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, double w, double e, double s, double n, double dval) {
759 double *y = NULL;
760 char *type = (gmt_M_y_is_lat (GMT, GMT_IN)) ? "parallel" : "y";
761 unsigned int i, ny = 0;
762
763 if (GMT->current.proj.z_down) {
764 if (GMT->current.proj.z_down == GMT_ZDOWN_Z) /* z = n - r */
765 ny = gmtlib_linear_array (GMT, 0.0, GMT->current.proj.z_radius-s, dval, GMT->current.map.frame.axis[GMT_Y].phase, &y);
766 else if (GMT->current.proj.z_down == GMT_ZDOWN_ZP) /* z = n - r */
767 ny = gmtlib_linear_array (GMT, GMT->current.proj.z_radius-n, GMT->current.proj.z_radius-s, dval, GMT->current.map.frame.axis[GMT_Y].phase, &y);
768 for (i = 0; i < ny; i++) {
769 if (GMT->current.proj.z_down == GMT_ZDOWN_ZP)
770 y[i] = GMT->current.proj.z_radius - y[i]; /* These are the z values needed for positioning */
771 else
772 y[i] = GMT->common.R.wesn[YHI] - y[i]; /* These are the radial values needed for positioning */
773 }
774 }
775 else
776 ny = gmtlib_linear_array (GMT, s, n, dval, GMT->current.map.frame.axis[GMT_Y].phase, &y);
777 for (i = 0; i < ny; i++) {
778 GMT_Report (GMT->parent, GMT_MSG_DEBUG, "Draw %s = %g from %g to %g\n", type, y[i], w, e);
779 gmtplot_map_latline (GMT, PSL, y[i], w, e);
780 }
781 if (ny) gmt_M_free (GMT, y);
782
783}
784
785GMT_LOCAL void gmtplot_x_grid (struct GMT_CTRL *GMT, struct PSL_CTRL *PSL, double s, double n, double *x, unsigned int nx) {
786 unsigned int i;

Callers 1

gmtplot_map_gridlinesFunction · 0.85

Calls 3

gmtlib_linear_arrayFunction · 0.85
GMT_ReportFunction · 0.85
gmtplot_map_latlineFunction · 0.85

Tested by

no test coverage detected