Group Abstract Group Abstract

Message Boards Message Boards

0
|
3K Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Ugly text in smooth shaded graphics

Posted 5 years ago

I've looked around but can't find the solution to the following problem: Why is text so ugly in smooth shaded graphics (ContourPlot, etc.)? Here's an illustration:

data = RandomReal[{0, 1}, {50, 2}];
{DensityHistogram[data, PlotLabel -> Style["Label 12345", 20], 
  PlotRange -> {{0, 1}, {0, 1}}, PlotRangePadding -> 0], 
 SmoothDensityHistogram[data, PlotLabel -> Style["Label 12345", 20], 
  PlotRange -> {{0, 1}, {0, 1}}, PlotRangePadding -> 0]}

This is what I get on my system (Mathematica 12.1, Windows 10): enter image description here The image magnification distorts the difference, but you can see that the text in the left image is smooth and antialiased, while the text in the right image is jagged and ugly.

Note that in Preferences, I've set Appearance/Graphics/Antialising quality to "highest." I realize that can save the image using a high ImageResolution value. But is there any option that I can set to get nice-looking text in these kinds of graphics in my notebook?

Thank you,

Mark

POSTED BY: Mark Wexler
3 Replies

Welcome to Wolfram Community!
Please make sure you know the rules: https://wolfr.am/READ-1ST
Please next time link your post to the duplicated one from MSE site.

POSTED BY: EDITORIAL BOARD
Posted 5 years ago

Crossposted here.

POSTED BY: Rohit Namjoshi

On my system this seems to work:

bckgr = SmoothDensityHistogram[data, PlotRange -> {{0, 1}, {0, 1}}, 
   PlotRangePadding -> None, ImagePadding -> None, Frame -> None];
Graphics[Inset[bckgr, {0, 0}, {0, 0}, 1], 
 PlotRange -> {{0, 1}, {0, 1}}, Frame -> True, 
 PlotLabel -> Style["Label 1234", 20]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard