Mathematica Rasterized density plot + countour plot in Mathematica (to solve EPS issues)

  • Thread starter abonatto
  • Start date
Dear All,

I am plotting a density and a contour plot of the same function in order to have a smooth shading in the background of the contour lines. I do this using "Show[DensityPlot[...], ContourPlot[..., ContourShading->None]", like the following example given by Mathematica help files:

Show[DensityPlot[Sin[x] Sin[y], {x, -3, 3}, {y, -3, 3}],
ContourPlot[Sin[x] Sin[y], {x, -3, 3}, {y, -3, 3},
ContourShading -> None]]

The problem is that, when I do this procedure to plot large lists of imported data, there are 2 big issues:

1st) there are some artifacts in the shading (like irregular grids of white lines).

2nd) if I export this as an EPS, the size of the generated file is huge!

As a solution I was thinking of rasterize the density plot (without frame, to have just the color gradient as a bitmap) and show it together with the contour plot (this way, all the contour lines and frame fonts would preserve their vectorial format). I have tried the following command:

Show[Rasterize[DensityPlot[...]], ContourPlot[..., ContourShading->None]

But it is not working. Any suggestions?

Regards.
 

Want to reply to this thread?

"Rasterized density plot + countour plot in Mathematica (to solve EPS issues)" You must log in or register to reply here.

Related Threads for: Rasterized density plot + countour plot in Mathematica (to solve EPS issues)

Replies
0
Views
2K
Replies
0
Views
4K
Replies
0
Views
2K
Replies
0
Views
1K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top