Reducing size of vector EPS / PDF output [message #91446] |
Thu, 16 July 2015 02:39  |
Fabzi
Messages: 305 Registered: July 2010
|
Senior Member |
|
|
Folks,
I draw many glacier outlines on a plot (using old-school graphics and
cgPolygon and stuff). The EPS/PDF output looks great but the file size
is too large (> 6 Mb), simply because the level of precision of my
shapefiles is very high (much higher than necessary for the plot itself).
Do you know of any way to tell IDL's postscript to reduce the precision
of the vectorized output? Or, as a workaround, any external tool that
could do the job?
Thanks,
Fabien
|
|
|
|
|
|
|
|
Re: Reducing size of vector EPS / PDF output [message #91470 is a reply to message #91469] |
Fri, 17 July 2015 06:31  |
Fabzi
Messages: 305 Registered: July 2010
|
Senior Member |
|
|
On 07/17/2015 02:59 PM, David Fanning wrote:
>>> Ha! Thanks, David. The code is quite crytpic to me (3 calls to
>>> spl_interp!?), but it works and makes beautiful curves;-)
> I don't understand it either. Craig wrote it for me. I do know it has
> been one of the most useful utility routines in the Coyote Library for
> me.:-)
It seems to be quite close to SPLINE_P, I just found out. Howver, with
SPLINE_P you have to estimate the tangent at the junction point by
yourself. See the following example:
pro test_curvature
x = [0.5, 1.5, 1.5, 0.5, 0.5]
y = [0.3, 0.3, 1.3, 1.3, 0.3]
ArcSample, x, y, xas, yas
spline_p, x, y, xsp, ysp
t = [1., -1]
spline_p, x, y, xsp2, ysp2, TAN0=t, TAN1=t
cgPlot, [0, 2], [0, 2], /NODATA, /WINDOW
cgPlots, x, y, color='black', /WINDOW
cgPlots, xas, yas, color='red6', /WINDOW
cgPlots, xsp, ysp, color='blu6', /WINDOW
cgPlots, xsp2, ysp2, color='blu4', /WINDOW
cgLegend, Titles=['ArcSample', 'spline_p', 'spline_p tangent'], $
LINESTYLES=[0,0,0], COLORS=['red6', 'blu6', 'blu4'], $
/ADDCMD, LOCATION=[0.2, 1.8], /DATA
end
|
|
|