Skip to Main Content Skip to Search
Product Documentation

PointSizethe size of points

This attribute sets the physical size with which points are plotted. E.g., PointSize = 1.5*unit::mm.

→ Examples

Attribute

Type

Value

See Also:

PointColor, PointStyle, PointsVisible

Details:

Example 1

We plot a cluster of points with random sizes within the unit square:

r := frandom:
plot(plot::Point2d(r(),r(), PointSize = 2*r()*unit::mm)
     $ i = 1 .. 200)

MuPAD graphics

delete r:

Example 2

Due to pixelation, there is only a discrete number of PointSize values that the renderers can display faithfully. Further, note that the large points may protrude over the edges of the viewing box without being clipped:

plot(plot::Point2d([i, 5], PointSize = i*0.1*unit::mm,
                   Color = RGB::Red)
     $ i = 1 .. 30,
     plot::Point2d([3*i, 15], PointSize = i*unit::mm,
                   Color = RGB::Green)
     $ i = 1 .. 10,
     plot::Point2d([9*i , 30], PointSize = i*unit::cm,
                   Color = RGB::Blue)
     $ i in [0.3, 0.5, 0.8, 1.3, 2, 3],
     ViewingBox = [0 .. 30, 0 .. 35], Axes = Boxed)

MuPAD graphics

Here are the same points in 3D. Note the threshold for PointSize beyond which the graphical points do not grow:

plot(plot::Point3d([i, 5, 0], PointSize = i*0.1*unit::mm,
                   Color = RGB::Red)
     $ i = 1 .. 30,
     plot::Point3d([3*i, 15, 0], PointSize = i*unit::mm,
                   Color = RGB::Green)
     $ i = 1 .. 10,
     plot::Point3d([9*i , 30, 0], PointSize = i*unit::cm,
                   Color = RGB::Blue)
     $ i in [0.3, 0.5, 0.8, 1.3, 2, 3],
     ViewingBox = [0 .. 30, 0 .. 35, -1 .. 1],
     Axes = Boxed, CameraDirection = [0, -10, 1000],
     YXRatio = 2/3)

MuPAD graphics

Example 3

We can access the PointSize attribute from a point and change it:

p := plot::Point2d(1, 2):
p::PointSize := 4*unit::inch:
p::PointSize

(508*unit::mm)/5

delete p:

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS