Data visualization with SAS programming

WARNING: This graph has too many graphical elements. You may not be able to get any vector graphics

Accepted Solution Solved
Reply
Trusted Advisor
Posts: 1,142
Accepted Solution

WARNING: This graph has too many graphical elements. You may not be able to get any vector graphics

Hi All,

 

I've got a job that uses ODS graphics to write a PDF graph with imagefmt=pdf.  Ran fine in 9.3, but in 9.4M3 it throws:

 

"WARNING: This graph has too many graphical elements. You may not be able to get any vector graphics output and in that case, you can set your output format to an image type."

 

Curious as to what might have changed between 9.3 and 9.4 that causes this, and if there might be away to get vector graph output even when there is a lot of output?  (analagous to antialiasmax)

 

Below trivial example replicates the problem in 9.4, but runs fine in 9.3.

 

data have;
  dv=5 ;
  do iv=1 to 20 ;
    do n=1 to 10000 ;
      output ;
    end ;
  end ;
run ;

proc template;
  define statgraph myplot;   
    begingraph;
      layout overlay ;
        seriesplot x=iv y=dv  ;
      endlayout; 
    endgraph;
  end;
run;

ods graphics /imagefmt=pdf ;
proc sgrender data=have template=myplot;
run ;

 

Yes, I realize above is using 200,000 data points to plot a horizontal line.   My actualy code is not quite that silly.  

 

In addition to whether I can tell SAS to avoid this limitation, curious what changed between 9.3 and 9.4.  Was 9.3 perhaps silently deciding to switch from a vector graph to some other image format?  Or was 9.3 willing to grind away for a long time and produce a vector graph with a lot of data in it?  Or....

 

Thanks,

--Q.


Accepted Solutions
Solution
‎03-15-2017 05:41 AM
SAS Employee
Posts: 24

Re: WARNING: This graph has too many graphical elements. You may not be able to get any vector graph

Hi Quentin,

 

This is an advisory warning that was introduced in SAS 9.4M3. The pdf ouput should still get generated. If your output is larger than what can be handled by the system, you will see a subsequent error message (out of memory) .

 

Do note, that loading a large vector graphics file, such as an SVG in some browsers will be very slow and will appear as if the system is hanging. The warning was introduced for that reason.

 

If smaller file sizes are important, a raster image output (even at reasonably large DPIs) will be smaller than the equivalent vector output in such cases.

 

With Regards,

 -Prashant.

View solution in original post


All Replies
Solution
‎03-15-2017 05:41 AM
SAS Employee
Posts: 24

Re: WARNING: This graph has too many graphical elements. You may not be able to get any vector graph

Hi Quentin,

 

This is an advisory warning that was introduced in SAS 9.4M3. The pdf ouput should still get generated. If your output is larger than what can be handled by the system, you will see a subsequent error message (out of memory) .

 

Do note, that loading a large vector graphics file, such as an SVG in some browsers will be very slow and will appear as if the system is hanging. The warning was introduced for that reason.

 

If smaller file sizes are important, a raster image output (even at reasonably large DPIs) will be smaller than the equivalent vector output in such cases.

 

With Regards,

 -Prashant.

Trusted Advisor
Posts: 1,142

Re: WARNING: This graph has too many graphical elements. You may not be able to get any vector graph

Thanks @PrashantH_sas, that's very helpful to know that this warning is advisory, and if an image truly cannot be produced, it will throw an error.  Unfortunately, our server is down for some scheduled maintenance, so I won't be able to play with this again until next week.  Probably will end up converting to raster image in the long term, but good to know that fort the short term I can safely ignore this warning (accepting the risk of longer process times).

 

--Q.

Post a Question
Discussion Stats
  • 2 replies
  • 108 views
  • 2 likes
  • 2 in conversation