MATLAB Answers

Asad Ali
4

R2014b How to disable graphics smoothing by default

Asked by Asad Ali
on 20 Oct 2014
Latest activity Commented on by Diogo
on 5 Mar 2015
Since I plot data with the objective of information extraction, and not to hang it on wall and show everyone its beauty, I would like to set the GraphicsSmoothing setting to 'off' by default. Please help me out and tell me how I can disable this forever.

  0 Comments

Sign in to comment.

1 Answer

Answer by Michelle Hirsch on 22 Oct 2014

Asad - Sorry that you don't like the new anti-aliased (smoothed) plots in R2014b. This has been one of the most requested graphics features for many years.
I think you might be misinterpreting the term "Graphics Smoothing" to think that it is doing more than it is. This property controls anti-aliasing, which is a technique to render smoother lines on a computer screen. Instead of representing each point on the screen as a single pixel, which can lead to jaggy lines (those of us who grew up in the era of Atari 2600 are familiar with the extreme case of aliased lines), anti-aliasing uses multiple pixels with different degrees of darkness. This results in lines which appear smoother. It does not invent data, like Excel used to do (still does?) if you told it to draw a line through points.
That said, if you still find that you don't want anti-aliased lines, you can use the standard mechanism for controlling defaults:
set(groot,'DefaultFigureGraphicsSmoothing','off')
Breaking this down:
  • Setting on the graphics root (groot) impacts all new figures.
  • The syntax of the property name is to smash together 'Default' Type Property
If you want this behavior to persist across sessions of MATLAB, you could put the above command in your startup.m file.

  1 Comment

Hi, I just want to make a comment on this answer. The smoothing is a really nice feature to have, but sometimes it is useful not to use it. I like to plot figures in tif format with high dpi and convert the figures to vectors in pdf format (usually a 2MB tif go to ~75KB pdf figure while remaining with the same quality). I usually can get really nice figures with previous versions of MATLAB. When there is sharp boundaries the pdf is much smaller (about 4 times smaller), but it still very high quality and you can zoom in or out without the annoying blurry colors on the edges. I don't know why even turning the text and graphics smoothing off I cannot have the same results that I was having in previous versions. In previous version lines would be continuous without smoothing. In the new version, if you turn off the smoothing the figures will have lines broken, specially the marker edges that were supposed to be a circle (if you chose 'o' marker for example). I would be glad to have the option to use legacy graphic style.

Sign in to comment.