AntiAliased

Antialiased lines and points

MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Value Summary

InheritedFALSE, or TRUE

Description

AntiAliased controls whether lines and points are drawn antialiased or not. With AntiAliased enabled graphics usually look smoother.

Examples

Example 1

We draw a points in different sizes and point styles. The black points are drawn with AntiAliased = FALSE, the blue points are drawn with AntiAliased = TRUE:

pointStyles := [Squares, FilledSquares, Circles,
                FilledCircles, Crosses, XCrosses,
                Diamonds, FilledDiamonds, Stars]:
pointSizes := [1.5, 3, 4.5, 6]:
plot(Axes = None, 
     (plot::Point2d(i, 2*j, AntiAliased = TRUE, 
                            PointStyle = pointStyles[i], 
                            PointSize = pointSizes[j],
                            Color = RGB::Blue), 
      plot::Point2d(i, 2*j + 1, AntiAliased = FALSE,
                                PointStyle = pointStyles[i], 
                                PointSize = pointSizes[j],
                                Color = RGB::Black))
      $ i = 1..nops(pointStyles) $ j = 1..nops(pointSizes)
    )

With horizontal lines we see not much difference between AntiAliased = FALSE (black lines) and AntiAliased = TRUE (blue lines):

lineStyles := [Solid, Dashed, Dotted]:
lineWidth := [.25, .5, .75, 1, 1.25, 1.5]:
plot(Axes = None, 
     (plot::Line2d([i, 2*j], [i+.8, 2*j],
                      AntiAliased = TRUE,
                      LineStyle = lineStyles[i], 
                      LineWidth = lineWidth[j],
                      Color = RGB::Blue), 
      plot::Line2d([i, 2*j+1], [i+.8, 2*j+1],
                         AntiAliased = FALSE,
                         LineStyle = lineStyles[i], 
                         LineWidth = lineWidth[j],
                         Color = RGB::Black))
      $ i = 1..nops(lineStyles) $ j = 1..nops(lineWidth)
    )

Diagonal lines are much smoother with AntiAliased = TRUE:

lineStyles := [Solid, Dashed, Dotted]:
lineWidth := [.25, .5, .75, 1, 1.25, 1.5]:
plot(Axes = None, 
     (plot::Line2d([i, 2*j], [i + .8, 2*j + 1], 
                            AntiAliased = TRUE,
                            LineStyle = lineStyles[i], 
                            LineWidth = lineWidth[j],
                            Color = RGB::Blue), 
      plot::Line2d([i, 2*j + 1], [i + .8, 2*j + 2],
                               AntiAliased = FALSE,
                               LineStyle = lineStyles[i], 
                               LineWidth = lineWidth[j],
                               Color = RGB::Black))
     $ i = 1..nops(lineStyles) $ j = 1..nops(lineWidth)
    )

By default curves are plotted with AntiAliased = TRUE (blue curve) which is much nicer:

f := plot::Curve2d([Re, Im](zeta(I*y + 1/2)), y = 0..42,
                                      AdaptiveMesh = 3):
f1 := plot::modify(f, AntiAliased = FALSE,
                      Color = RGB::Black):
plot(
     f, plot::Translate2d([5, 0], f1), XAxisTitle = "Re(z)",
                                       YAxisTitle = "Im(z)"
    )

See Also

MuPAD Functions