Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7011669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:09:24+00:00 2026-05-27T22:09:24+00:00

When exporting rather complicated plots (especially ListDensityPlot ) as a PDF or EPS (for

  • 0

When exporting rather complicated plots (especially ListDensityPlot) as a PDF or EPS (for publication, for example), the resulting file size can be quite large. For example:

data = Flatten[Table[{f0, f, Exp[-(f - f0)^2/25^2]}, {f0, 500, 700, 5}, {f, 300, 
 900}], 1];
plot=ListDensityPlot[data,PlotRange->{Automatic,Automatic,{0,1}},InterpolationOrder->0]

Mathematica graphics

This example data set is on the order of the size I typically work with. When I export using Export["C:\\test.pdf", plot], it generates a PDF file 23.9MB in size. If I instead try Export["C:\\test1.pdf", Rasterize[plot]] it is far smaller, but the integrity and rescalability of the image naturally suffers.

This is complicated further if my actual figure is a combined plot, such as (Edit: f goes to 900)

plot2 = Show[plot, Plot[x, {x, 500, 900}, PlotStyle -> Thick]]

Mathematica graphics

(or with some usage of Epilog) where I’d love to have the background ListDensityPlot be rasterized, but keep the other markup and plots in “vector” form. Or at the very least, the frame labels be non-rasterized.

Is there any way to do this?

Or, to accomplish the same goal via some other clever method?


Update

I’ve checked out the related question, but that’s gotta be way more complicated than it needs to be (essentially exporting then importing). I’ve been able to utilize some of the tricks in that question to extract the plot separately from the axes:

axes = Graphics[{}, Options[plot2]]

Mathematica graphics

plots = Graphics[plot2[[1]]]

Mathematica graphics

But, the plots term loses the AspectRatio and PlotRange, etc. plots can be hit with a Rasterize, but it needs dimensional fixing.

And then, how to combine them together?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:09:24+00:00Added an answer on May 27, 2026 at 10:09 pm

    This is exactly the kind of problem for which I wrote the function linked here:
    http://pages.uoregon.edu/noeckel/computernotes/Mathematica/listContourDensityPlot.html

    It’s based on the same idea as in Heike’s answer — I just added some more features so that you can safely change the aspect ratio, opacity, and combine with other plots. See my comment in Heike’s answer.

    To try it with your data, do something like this:

    plot = Show[
     listContourDensityPlot[data, 
      PlotRange -> {Automatic, Automatic, {0, 1}}, 
      InterpolationOrder -> 0, Contours -> None], 
     Graphics[Line[{{500, 500}, {700, 700}}]]]
    

    There are a couple of similar functions linked from the parent page, too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am programmatically exporting data (using PHP 5.2) into a .csv test file. Example
Exporting some data from mysql to a csv file using FasterCSV. I'd like the
When exporting a Visual Studio project to a Template (File/Export Template...) I get the
I am exporting data table from php page to pdf I got the page
I'm exporting data programatically from Excel to SQL Server 2005 using SqlBulkCopy. It works
i am exporting data to csv, while exporting i want to split by every
I am writing an exporting function to take data from a database table and
I am exporting a datatable to an excel sheet successfully... In that excel sheet
I am exporting datatable in MSEXCEL.I need to Assign MultipleLines in a cell in
I am exporting data from php page to word,, there i get 'n' number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.