comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem writing SCATTERPLOT() with more than 4096 points to PDF file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Problem writing SCATTERPLOT() with more than 4096 points to PDF file [message #94323 is a reply to message #91178] Mon, 10 April 2017 11:18 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Thursday, June 11, 2015 at 5:26:22 PM UTC-6, Chris Torrence wrote:
> On Thursday, June 11, 2015 at 1:00:50 PM UTC-6, Helder wrote:
>> On Thursday, June 11, 2015 at 8:19:37 PM UTC+2, wlandsman wrote:
>>> I am having problems writing a SCATTERPLOT() to a PDF file.
>>>
>>> The following plot displays correctly in a window.
>>>
>>> x = randomn(seed,4096)
>>> y = randomn(seed,4096)
>>> p = scatterplot(x,y,/sym_filled,sym_color='blue',symbol='circle' )
>>>
>>> But when I then try to save to a PDF file, I get the error message:
>>>
>>> % SAVE: Error in PDF creation: INVALID_SHADING
>>>
>>> I have no problems when saving the plot in other data formats.
>>>
>>> There also is no problem if I plot less than 4096 points.
>>>
>>> Finally, the problem still exists if I first open a window with /BUFFER and write directly to a PDF file.
>>>
>>> Thanks, --Wayne
>>>
>>>
>>> w = window(dimen=[800,1100],/buffer)
>>> x = randomn(seed,4096)
>>> y = randomn(seed,4096)
>>>
>>> p = scatterplot(x,y,/current,/sym_filled,sym_color='blue',symbol ='circle')
>>> w.save,'test.pdf'
>>>
>>> IDL> print,!version
>>> { x86_64 darwin unix Mac OS X 8.4 Sep 27 2014 64 64}
>>
>> Just to add some statistics: I get the same results.
>> IDL> !version
>> {
>> "ARCH": "x86_64",
>> "OS": "Win32",
>> "OS_FAMILY": "Windows",
>> "OS_NAME": "Microsoft Windows",
>> "RELEASE": "8.4.1",
>> "BUILD_DATE": "Feb 17 2015",
>> "MEMORY_BITS": 64,
>> "FILE_OFFSET_BITS": 64
>> }
>>
>> Cheers,
>> Helder
>
> I can confirm that this is indeed a bug. I doubt it will get fixed for IDL 8.5. As a workaround, you can use the /BITMAP keyword when saving to the PDF.
>
> Cheers,
> Chris

It's been a while, but I did some more digging. This is actually a limitation of the PDF 1.4 specification. You can only have up to 4095 shading elements. See the spec here:
http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pd f_reference_archives/PDFReference.pdf

So unfortunately there's no way for us to fix this. The best workaround is to use /BITMAP.

Cheers,
Chris
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: parse subdirectories
Next Topic: masking float/interger arrays in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:10:48 PDT 2025

Total time taken to generate the page: 0.00379 seconds