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

Home » Public Forums » archive » EPS output from functional graphic 'LARGE' size
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
EPS output from functional graphic 'LARGE' size [message #90442] Mon, 02 March 2015 20:00 Go to next message
Haojie Xu is currently offline  Haojie Xu
Messages: 5
Registered: March 2015
Junior Member
Hi there,

I use IDL functional graphic to create eps file inserted to latex
but however, I found the size of eps file is way too large.
say,
IDL> x = [0:100:0.1]
IDL> pl = plot(x,sin(x),'-b')
IDL> pl.Save,'test_sin.eps'

it ends up with a file like 46Megabytes file.
For pdf output file, it seems okay, reasonable size but I found preview has some issue to opensome pdf output file from IDL.

Is there any suggestion that I can use functional graphics to produce elegant eps file?


Thanks
H
Re: EPS output from functional graphic 'LARGE' size [message #90460 is a reply to message #90442] Tue, 03 March 2015 09:12 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Monday, March 2, 2015 at 9:00:05 PM UTC-7, Haojie Xu wrote:
> Hi there,
>
> I use IDL functional graphic to create eps file inserted to latex
> but however, I found the size of eps file is way too large.
> say,
> IDL> x = [0:100:0.1]
> IDL> pl = plot(x,sin(x),'-b')
> IDL> pl.Save,'test_sin.eps'
>
> it ends up with a file like 46Megabytes file.
> For pdf output file, it seems okay, reasonable size but I found preview has some issue to opensome pdf output file from IDL.
>
> Is there any suggestion that I can use functional graphics to produce elegant eps file?
>
>
> Thanks
> H

Hi H,

It looks like it is defaulting to "bitmap" format instead of "vector". I don't know why. When I run your commands I get a tiny EPS file (only about 24 KB). Try forcing it to use vector:

pl.Save,'test_sin.eps',bitmap=0

Cheers,
Chris
ExelisVIS
Re: EPS output from functional graphic 'LARGE' size [message #90462 is a reply to message #90460] Tue, 03 March 2015 09:35 Go to previous messageGo to next message
Haojie Xu is currently offline  Haojie Xu
Messages: 5
Registered: March 2015
Junior Member
On Tuesday, March 3, 2015 at 10:12:48 AM UTC-7, Chris Torrence wrote:
> On Monday, March 2, 2015 at 9:00:05 PM UTC-7, Haojie Xu wrote:
>> Hi there,
>>
>> I use IDL functional graphic to create eps file inserted to latex
>> but however, I found the size of eps file is way too large.
>> say,
>> IDL> x = [0:100:0.1]
>> IDL> pl = plot(x,sin(x),'-b')
>> IDL> pl.Save,'test_sin.eps'
>>
>> it ends up with a file like 46Megabytes file.
>> For pdf output file, it seems okay, reasonable size but I found preview has some issue to opensome pdf output file from IDL.
>>
>> Is there any suggestion that I can use functional graphics to produce elegant eps file?
>>
>>
>> Thanks
>> H
>
> Hi H,
>
> It looks like it is defaulting to "bitmap" format instead of "vector". I don't know why. When I run your commands I get a tiny EPS file (only about 24 KB). Try forcing it to use vector:
>
> pl.Save,'test_sin.eps',bitmap=0
>
> Cheers,
> Chris
> ExelisVIS

Hi Chris,

Yes, you are right. I use bitmap = 1 for default because I use some symbols in labels or titles,i.e., $M_{\odot}$, which is required to add this flag to show correctly on vector eps and pdf.

To avoid this, maybe I can use some function like 'TEXTOIDL' to produce the string I need and then put it on whatever I want.

Sounds ok?(I have not text this idea yet ) or maybe other elegant way?

Best,
H
Re: EPS output from functional graphic 'LARGE' size [message #90463 is a reply to message #90462] Tue, 03 March 2015 10:38 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Tuesday, March 3, 2015 at 10:36:01 AM UTC-7, Haojie Xu wrote:
> On Tuesday, March 3, 2015 at 10:12:48 AM UTC-7, Chris Torrence wrote:
>> On Monday, March 2, 2015 at 9:00:05 PM UTC-7, Haojie Xu wrote:
>>> Hi there,
>>>
>>> I use IDL functional graphic to create eps file inserted to latex
>>> but however, I found the size of eps file is way too large.
>>> say,
>>> IDL> x = [0:100:0.1]
>>> IDL> pl = plot(x,sin(x),'-b')
>>> IDL> pl.Save,'test_sin.eps'
>>>
>>> it ends up with a file like 46Megabytes file.
>>> For pdf output file, it seems okay, reasonable size but I found preview has some issue to opensome pdf output file from IDL.
>>>
>>> Is there any suggestion that I can use functional graphics to produce elegant eps file?
>>>
>>>
>>> Thanks
>>> H
>>
>> Hi H,
>>
>> It looks like it is defaulting to "bitmap" format instead of "vector". I don't know why. When I run your commands I get a tiny EPS file (only about 24 KB). Try forcing it to use vector:
>>
>> pl.Save,'test_sin.eps',bitmap=0
>>
>> Cheers,
>> Chris
>> ExelisVIS
>
> Hi Chris,
>
> Yes, you are right. I use bitmap = 1 for default because I use some symbols in labels or titles,i.e., $M_{\odot}$, which is required to add this flag to show correctly on vector eps and pdf.
>
> To avoid this, maybe I can use some function like 'TEXTOIDL' to produce the string I need and then put it on whatever I want.
>
> Sounds ok?(I have not text this idea yet ) or maybe other elegant way?
>
> Best,
> H

If you are using symbols like that, then you will have to use bitmap. But, EPS is very inefficient with bitmap. Perhaps you should switch to PNG, and then import your image into LaTeX.

-Chris
Re: EPS output from functional graphic 'LARGE' size [message #90464 is a reply to message #90463] Tue, 03 March 2015 10:54 Go to previous messageGo to next message
Haojie Xu is currently offline  Haojie Xu
Messages: 5
Registered: March 2015
Junior Member
On Tuesday, March 3, 2015 at 11:38:34 AM UTC-7, Chris Torrence wrote:
> On Tuesday, March 3, 2015 at 10:36:01 AM UTC-7, Haojie Xu wrote:
>> On Tuesday, March 3, 2015 at 10:12:48 AM UTC-7, Chris Torrence wrote:
>>> On Monday, March 2, 2015 at 9:00:05 PM UTC-7, Haojie Xu wrote:
>>>> Hi there,
>>>>
>>>> I use IDL functional graphic to create eps file inserted to latex
>>>> but however, I found the size of eps file is way too large.
>>>> say,
>>>> IDL> x = [0:100:0.1]
>>>> IDL> pl = plot(x,sin(x),'-b')
>>>> IDL> pl.Save,'test_sin.eps'
>>>>
>>>> it ends up with a file like 46Megabytes file.
>>>> For pdf output file, it seems okay, reasonable size but I found preview has some issue to opensome pdf output file from IDL.
>>>>
>>>> Is there any suggestion that I can use functional graphics to produce elegant eps file?
>>>>
>>>>
>>>> Thanks
>>>> H
>>>
>>> Hi H,
>>>
>>> It looks like it is defaulting to "bitmap" format instead of "vector". I don't know why. When I run your commands I get a tiny EPS file (only about 24 KB). Try forcing it to use vector:
>>>
>>> pl.Save,'test_sin.eps',bitmap=0
>>>
>>> Cheers,
>>> Chris
>>> ExelisVIS
>>
>> Hi Chris,
>>
>> Yes, you are right. I use bitmap = 1 for default because I use some symbols in labels or titles,i.e., $M_{\odot}$, which is required to add this flag to show correctly on vector eps and pdf.
>>
>> To avoid this, maybe I can use some function like 'TEXTOIDL' to produce the string I need and then put it on whatever I want.
>>
>> Sounds ok?(I have not text this idea yet ) or maybe other elegant way?
>>
>> Best,
>> H
>
> If you are using symbols like that, then you will have to use bitmap. But, EPS is very inefficient with bitmap. Perhaps you should switch to PNG, and then import your image into LaTeX.
>
> -Chris

Thanks,Chris. Well, It seems some astronomical journal only accept post script file. Sigh~

Also, I tried to save to pdf, with bitmap flag on. When I open it via preview, it totally go blur and sometime make my computer crash. Is here any one to find this weird thing?

-H
Re: EPS output from functional graphic 'LARGE' size [message #90465 is a reply to message #90464] Tue, 03 March 2015 11:08 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Haojie Xu writes:

> Thanks,Chris. Well, It seems some astronomical journal only accept post script file. Sigh~
>
> Also, I tried to save to pdf, with bitmap flag on. When I open it via preview, it totally go blur and sometime make my computer crash. Is here any one to find this weird thing?

Another alternative would be to use Coyote Graphics to create your
PostScript file. You can use TexToIDL directly:

https://www.idlcoyote.com/cg_tips/textoidl.php

The PostScript output will be a "normal" size. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: EPS output from functional graphic 'LARGE' size [message #90468 is a reply to message #90464] Tue, 03 March 2015 12:11 Go to previous messageGo to next message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Tuesday, March 3, 2015 at 11:54:25 AM UTC-7, Haojie Xu wrote:
>
> Thanks,Chris. Well, It seems some astronomical journal only accept post script file. Sigh~
>
> Also, I tried to save to pdf, with bitmap flag on. When I open it via preview, it totally go blur and sometime make my computer crash. Is here any one to find this weird thing?
>
> -H

Hi H,
I think you could easily embed the PNG file into the Postscript. There are even a bunch of online converters.
-Chris
Re: EPS output from functional graphic 'LARGE' size [message #90470 is a reply to message #90468] Tue, 03 March 2015 12:51 Go to previous messageGo to next message
Haojie Xu is currently offline  Haojie Xu
Messages: 5
Registered: March 2015
Junior Member
On Tuesday, March 3, 2015 at 1:11:51 PM UTC-7, Chris Torrence wrote:
> On Tuesday, March 3, 2015 at 11:54:25 AM UTC-7, Haojie Xu wrote:
>>
>> Thanks,Chris. Well, It seems some astronomical journal only accept post script file. Sigh~
>>
>> Also, I tried to save to pdf, with bitmap flag on. When I open it via preview, it totally go blur and sometime make my computer crash. Is here any one to find this weird thing?
>>
>> -H
>
> Hi H,
> I think you could easily embed the PNG file into the Postscript. There are even a bunch of online converters.
> -Chris

Hi Chris,
Well, I think I did that. convert PNG file to eps file on linux shell command line but the eps is huge as I said. All of plots are with /bitmap on, though one can twinkle eps2pdf, or eps2eps thing to make this file smaller. Just like the simple example in the beginning, when I save it with PNG format, it is only 93K. and then do convert test.png to test.eps. It is 74M. Probably I'm not doing the right way to convert.

-H
Re: EPS output from functional graphic 'LARGE' size [message #90471 is a reply to message #90465] Tue, 03 March 2015 12:54 Go to previous message
Haojie Xu is currently offline  Haojie Xu
Messages: 5
Registered: March 2015
Junior Member
On Tuesday, March 3, 2015 at 12:08:47 PM UTC-7, David Fanning wrote:
> Haojie Xu writes:
>
>> Thanks,Chris. Well, It seems some astronomical journal only accept post script file. Sigh~
>>
>> Also, I tried to save to pdf, with bitmap flag on. When I open it via preview, it totally go blur and sometime make my computer crash. Is here any one to find this weird thing?
>
> Another alternative would be to use Coyote Graphics to create your
> PostScript file. You can use TexToIDL directly:
>
> https://www.idlcoyote.com/cg_tips/textoidl.php
>
> The PostScript output will be a "normal" size. :-)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Thanks David. Before I use new graphic to produce nice plot, I use coyote library a lot. Probably I need to go back to rewrite part of the scripts to produce such eps file.

-Haojie
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Function fitting in IDL
Next Topic: Semi-transparent filled contours with direct graphics

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

Current Time: Wed Oct 08 09:13:56 PDT 2025

Total time taken to generate the page: 0.00562 seconds