diff --git a/etc/NEWS.10.md b/etc/NEWS.10.md index 45ac00e4ad..627f2848a8 100644 --- a/etc/NEWS.10.md +++ b/etc/NEWS.10.md @@ -48,7 +48,10 @@ Summary of important user-visible changes for version 10 (yyyy-mm-dd): `'rtick'` by the function `rticks` will only include the center tick mark value if it is specified. -- `view` correctly interprets cartesian viewpoints on main axes (bug #65641). +- `view` correctly interprets Cartesian viewpoints on main axes (bug #65641). + +- `plot3` now draws a single marker if only one data point is given. + Previously the plot was blank (`marker` = "none") which was confusing. ### Matlab compatibility diff --git a/scripts/plot/draw/plot3.m b/scripts/plot/draw/plot3.m index d6f241e9ff..41bda7616f 100644 --- a/scripts/plot/draw/plot3.m +++ b/scripts/plot/draw/plot3.m @@ -212,7 +212,13 @@ linestyle = options.linestyle; marker = options.marker; if (isempty (marker) && isempty (linestyle)) - [linestyle, marker] = __next_line_style__ (); + if (isscalar (x)) + ## If unspecified, marker for a point is always "." + linestyle = "-"; + marker = "."; + else + [linestyle, marker] = __next_line_style__ (); + endif endif color = options.color; if (isempty (color)) @@ -268,7 +274,13 @@ linestyle = options.linestyle; marker = options.marker; if (isempty (marker) && isempty (linestyle)) - [linestyle, marker] = __next_line_style__ (); + if (isscalar (x)) + ## If unspecified, marker for a point is always "." + linestyle = "-"; + marker = "."; + else + [linestyle, marker] = __next_line_style__ (); + endif endif color = options.color; if (isempty (color)) @@ -344,7 +356,13 @@ linestyle = options.linestyle; marker = options.marker; if (isempty (marker) && isempty (linestyle)) - [linestyle, marker] = __next_line_style__ (); + if (isscalar (x)) + ## If unspecified, marker for a point is always "." + linestyle = "-"; + marker = "."; + else + [linestyle, marker] = __next_line_style__ (); + endif endif color = options.color; if (isempty (color))