| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bdf5412 commit f6aa666
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,17 @@ | |||
| 1 | + 2016-09-10 Ethan A Merritt <merritt@u.washington.edu> | ||
| 2 | + | ||
| 3 | + * src/graph3d.c src/graph3d.h src/mouse.c src/save.c src/set.c | ||
| 4 | + src/show.c src/unset.c src/eval.c docs/gnuplot.doc demo/azimuth.dem: | ||
| 5 | + | ||
| 6 | + New command "set view azimuth <angle-in-degrees>" | ||
| 7 | + Changing the view angles rot_x and rot_z cannot move the z axis out of | ||
| 8 | + the plane normal to the canvas horizontal. This patch adds a new angular | ||
| 9 | + setting "azimuth" that rotates the plane containing the z axis about | ||
| 10 | + the line of sight. I.e. "set view azimuth 90" places the z axis | ||
| 11 | + parallel to the canvas horizontal rather than the canvas vertical. | ||
| 12 | + Click-and-drag with right mouse button provides interactive control of | ||
| 13 | + the azimuth. Azimuth is ignored by 2D plots and by "set view map". | ||
| 14 | + | ||
| 1 | 15 | 2016-09-09 Shigeharu Takeno <shige@iee.niit.ac.jp> | |
| 2 | 16 | ||
| 3 | 17 | * docs/term-ja.diff docs/gnuplot-ja.doc: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,7 @@ Changes not in 5.0 | |||
| 22 | 22 | * NEW command "set minussign" (first appeared in 5.0.5) | |
| 23 | 23 | * NEW "smooth fnormal" normalized frequency | |
| 24 | 24 | * NEW terminal domterm (supports in-line SVG in DomTerm terminal emulator) | |
| 25 | + * NEW "set view azimuth <angle>" controls azimuth of the z axis in 3D plots | ||
| 25 | 26 | * CHANGE Revise placement of axis labels in 3D plots | |
| 26 | 27 | * CHANGE Track font/enhanced for key title separately from the key entries | |
| 27 | 28 | * CHANGE order of margins in `set margins <left>, <right>, <bottom>, <top>` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | # | |
| 2 | - # $Id: all.dem,v 1.74 2016-08-04 03:42:27 sfeam Exp $ | ||
| 2 | + # $Id: all.dem,v 1.75 2016-09-10 05:46:21 sfeam Exp $ | ||
| 3 | 3 | # | |
| 4 | 4 | # Executes all demos (OK, MOST demos) in this directory. | |
| 5 | 5 | # This serves as a series of unit tests for non-interactive capabilities. | |
@@ -159,6 +159,10 @@ print "******************** file surface2.dem ********************" | |||
| 159 | 159 | load "surface2.dem" | |
| 160 | 160 | reset | |
| 161 | 161 | ||
| 162 | + print "******************** file azimuth.dem ********************" | ||
| 163 | + load "azimuth.dem" | ||
| 164 | + reset | ||
| 165 | + | ||
| 162 | 166 | print "******************** file contours.dem ********************" | |
| 163 | 167 | load "contours.dem" | |
| 164 | 168 | reset | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,35 @@ | |||
| 1 | + set view equal xy | ||
| 2 | + set zzeroaxis; set xzeroaxis; set yzeroaxis | ||
| 3 | + set xyplane at 0 | ||
| 4 | + unset border | ||
| 5 | + unset key | ||
| 6 | + unset xtics | ||
| 7 | + unset ytics | ||
| 8 | + set ztics axis | ||
| 9 | + | ||
| 10 | + set arrow 1 from 0,0,0 to 1,0,0 head filled lw 1.5 | ||
| 11 | + set label 1 at 1.2,0,0 "X" center | ||
| 12 | + set arrow 2 from 0,0,0 to 0,1,0 head filled lw 1.5 | ||
| 13 | + set label 2 at 0,1.2,0 "Y" center | ||
| 14 | + set arrow 3 from 0,0,0 to 0,0,21 head filled lw 1.5 | ||
| 15 | + set label 3 at 0,0,23 "Z" center | ||
| 16 | + | ||
| 17 | + set view 60, 30, 1., 1.75 | ||
| 18 | + | ||
| 19 | + set multiplot layout 1,3 | ||
| 20 | + | ||
| 21 | + set view azimuth 0. | ||
| 22 | + set title 'azimuth 0' offset 0,2 | ||
| 23 | + splot sample [t=0:20] '+' using (cos($1)):(sin($1)):($1) with lines lw 2 | ||
| 24 | + | ||
| 25 | + set title 'azimuth 10' offset 0,2 | ||
| 26 | + set view azimuth 10. | ||
| 27 | + replot | ||
| 28 | + | ||
| 29 | + set title 'azimuth 60' offset 0,2 | ||
| 30 | + set view azimuth 60. | ||
| 31 | + replot | ||
| 32 | + | ||
| 33 | + unset multiplot | ||
| 34 | + pause -1 "Hit return to continue" | ||
| 35 | + reset | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | # | |
| 2 | - # $Id: world.dem,v 1.11 2014/10/05 00:33:15 sfeam Exp $ | ||
| 2 | + # $Id: world.dem,v 1.12 2016-09-10 05:46:22 sfeam Exp $ | ||
| 3 | 3 | # | |
| 4 | 4 | # | |
| 5 | 5 | set title "Gnuplot Correspondences\ngeographic coordinate system" | |
@@ -27,6 +27,7 @@ set angles degrees | |||
| 27 | 27 | set title "3D version using spherical coordinate system" | |
| 28 | 28 | set ticslevel 0 | |
| 29 | 29 | set view 70,40,0.8,1.2 | |
| 30 | + set view equal xyz | ||
| 30 | 31 | set mapping spherical | |
| 31 | 32 | set parametric | |
| 32 | 33 | set samples 32 | |
@@ -56,6 +57,7 @@ unset arrow | |||
| 56 | 57 | set title "3D version using cylindrical coordinate system" | |
| 57 | 58 | set ticslevel 0.0 | |
| 58 | 59 | set view 70,40,0.8,1.2 | |
| 60 | + set view equal xy | ||
| 59 | 61 | set mapping cylindrical | |
| 60 | 62 | set parametric | |
| 61 | 63 | set samples 32 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - C RCS $Id: gnuplot.doc,v 1.1018 2016-09-08 20:17:04 sfeam Exp $ | ||
| 1 | + C RCS $Id: gnuplot.doc,v 1.1019 2016-09-10 05:46:22 sfeam Exp $ | ||
| 2 | 2 | C | |
| 3 | 3 | C Copyright (C) 1986 - 1993, 1998, 1999, 2000, 2001, 2004 Thomas Williams, Colin Kelley et al. | |
| 4 | 4 | C | |
@@ -204,6 +204,8 @@ C | |||
| 204 | 204 | ||
| 205 | 205 | * New commands `break` and `continue` allow more complicated loop structure. | |
| 206 | 206 | ||
| 207 | + * 3D plots can be rotated about the line of sight (see `set view azimuth`). | ||
| 208 | + | ||
| 207 | 209 | * Support for array variables (see `arrays`). | |
| 208 | 210 | ||
| 209 | 211 | * Support for nonlinear axes (see `set nonlinear`). | |
@@ -13142,6 +13144,7 @@ Ffigure_multiple_keys | |||
| 13142 | 13144 | set view <rot_x>{,{<rot_z>}{,{<scale>}{,<scale_z>}}} | |
| 13143 | 13145 | set view map {scale <scale>} | |
| 13144 | 13146 | set view {no}equal {xy|xyz} | |
| 13147 | + set view azimuth <angle> | ||
| 13145 | 13148 | show view | |
| 13146 | 13149 | ||
| 13147 | 13150 | where <rot_x> and <rot_z> control the rotation angles (in degrees) in a | |
@@ -13167,6 +13170,17 @@ Ffigure_multiple_keys | |||
| 13167 | 13170 | ||
| 13168 | 13171 | The first sets all the four default values. The second changes only scale, | |
| 13169 | 13172 | to 0.5. | |
| 13173 | + 4 azimuth | ||
| 13174 | + ?set view azimuth | ||
| 13175 | + ?view azimuth | ||
| 13176 | + ?azimuth | ||
| 13177 | + set view azimuth <angle-in-degrees> | ||
| 13178 | + The setting of azimuth affects the orientation of the z axis in a 3D graph | ||
| 13179 | + (splot). At the default azimuth = 0 the z axis of the plot lies in the plane | ||
| 13180 | + orthogonal to the screen horizontal. I.e. the projection of the z axis lies | ||
| 13181 | + along the screen vertical. Non-zero azimuth rotates the plot about the line | ||
| 13182 | + of sight through the origin so that a projection of the z axis is no longer | ||
| 13183 | + vertical. When azimuth = 90 the z axis is horizontal rather than vertical. | ||
| 13170 | 13184 | 4 equal_axes | |
| 13171 | 13185 | ?set view equal_axes | |
| 13172 | 13186 | ?set view equal xyz | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: eval.c,v 1.139 2016-09-08 15:21:02 markisch Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: eval.c,v 1.140 2016-09-10 05:46:22 sfeam Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - eval.c */ | |
@@ -972,6 +972,7 @@ update_gpval_variables(int context) | |||
| 972 | 972 | fill_gpval_float("GPVAL_VIEW_ROT_Z", surface_rot_z); | |
| 973 | 973 | fill_gpval_float("GPVAL_VIEW_SCALE", surface_scale); | |
| 974 | 974 | fill_gpval_float("GPVAL_VIEW_ZSCALE", surface_zscale); | |
| 975 | + fill_gpval_float("GPVAL_VIEW_AZIMUTH", azimuth); | ||
| 975 | 976 | return; | |
| 976 | 977 | } | |
| 977 | 978 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.345 2016-09-06 22:53:17 sfeam Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: graph3d.c,v 1.346 2016-09-10 05:46:22 sfeam Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - graph3d.c */ | |
@@ -95,6 +95,7 @@ float surface_scale = 1.0; | |||
| 95 | 95 | float surface_zscale = 1.0; | |
| 96 | 96 | float surface_lscale = 0.0; | |
| 97 | 97 | float mapview_scale = 1.0; | |
| 98 | + float azimuth = 0.0; | ||
| 98 | 99 | ||
| 99 | 100 | /* Set by 'set view map': */ | |
| 100 | 101 | int splot_map = FALSE; | |
@@ -638,10 +639,11 @@ do_3dplot( | |||
| 638 | 639 | mat_scale(surface_scale / 2.0, surface_scale / 2.0, surface_scale / 2.0, mat); | |
| 639 | 640 | mat_mult(trans_mat, trans_mat, mat); | |
| 640 | 641 | ||
| 641 | - /* The extrema need to be set even when a surface is not being | ||
| 642 | - * drawn. Without this, gnuplot used to assume that the X and | ||
| 643 | - * Y axis started at zero. -RKC | ||
| 644 | - */ | ||
| 642 | + /* The azimuth is applied as a rotation about the line of sight */ | ||
| 643 | + if (azimuth !=0 && !splot_map) { | ||
| 644 | + mat_rot_z(azimuth, mat); | ||
| 645 | + mat_mult(trans_mat, trans_mat, mat); | ||
| 646 | + } | ||
| 645 | 647 | ||
| 646 | 648 | if (polar) | |
| 647 | 649 | int_error(NO_CARET,"Cannot splot in polar coordinate system."); | |
@@ -806,7 +808,7 @@ do_3dplot( | |||
| 806 | 808 | * difference for other terminals. If it causes problems, then we will need | |
| 807 | 809 | * a separate BoundingBox structure to track the actual 3D graph box. | |
| 808 | 810 | */ | |
| 809 | - else { | ||
| 811 | + else if (azimuth == 0) { | ||
| 810 | 812 | int xl, xb, xr, xf, yl, yb, yr, yf; | |
| 811 | 813 | ||
| 812 | 814 | map3d_xy(zaxis_x, zaxis_y, base_z, &xl, &yl); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | /* | |
| 2 | - * $Id: graph3d.h,v 1.51 2016-05-09 03:32:27 sfeam Exp $ | ||
| 2 | + * $Id: graph3d.h,v 1.52 2016-09-10 05:46:22 sfeam Exp $ | ||
| 3 | 3 | */ | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - graph3d.h */ | |
@@ -151,6 +151,7 @@ extern float surface_scale; | |||
| 151 | 151 | extern float surface_zscale; | |
| 152 | 152 | extern float surface_lscale; | |
| 153 | 153 | extern float mapview_scale; | |
| 154 | + extern float azimuth; | ||
| 154 | 155 | extern int splot_map; | |
| 155 | 156 | ||
| 156 | 157 | typedef struct { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,5 @@ | |||
| 1 | 1 | #ifndef lint | |
| 2 | - static char *RCSid() { return RCSid("$Id: mouse.c,v 1.190 2016-08-06 05:47:08 sfeam Exp $"); } | ||
| 2 | + static char *RCSid() { return RCSid("$Id: mouse.c,v 1.191 2016-09-10 05:46:22 sfeam Exp $"); } | ||
| 3 | 3 | #endif | |
| 4 | 4 | ||
| 5 | 5 | /* GNUPLOT - mouse.c */ | |
@@ -2119,7 +2119,12 @@ event_motion(struct gp_event_t *ge) | |||
| 2119 | 2119 | start_x = mouse_x; | |
| 2120 | 2120 | start_y = mouse_y; | |
| 2121 | 2121 | redraw = TRUE; | |
| 2122 | - } /* if (mousebutton 2 is down) */ | ||
| 2122 | + } else if (button & (1 << 3)) { | ||
| 2123 | + /* dragging with button 3 -> change azimuth */ | ||
| 2124 | + azimuth += (mouse_x - start_x) * 90.0 / term->xmax; | ||
| 2125 | + start_x = mouse_x; | ||
| 2126 | + redraw = TRUE; | ||
| 2127 | + } | ||
| 2123 | 2128 | ||
| 2124 | 2129 | if (!ALMOST2D) { | |
| 2125 | 2130 | turn_ruler_off(); | |
@@ -2136,6 +2141,7 @@ event_motion(struct gp_event_t *ge) | |||
| 2136 | 2141 | fill_gpval_float("GPVAL_VIEW_ROT_Z", surface_rot_z); | |
| 2137 | 2142 | fill_gpval_float("GPVAL_VIEW_SCALE", surface_scale); | |
| 2138 | 2143 | fill_gpval_float("GPVAL_VIEW_ZSCALE", surface_zscale); | |
| 2144 | + fill_gpval_float("GPVAL_VIEW_AZIMUTH", azimuth); | ||
| 2139 | 2145 | } else { | |
| 2140 | 2146 | /* postpone the replotting */ | |
| 2141 | 2147 | needreplot = TRUE; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments