help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: print resolution in latex


From: Juan Pablo Carbajal
Subject: Re: print resolution in latex
Date: Mon, 16 Jan 2012 17:33:24 +0100

On Mon, Jan 16, 2012 at 4:46 PM, Reza Housseini
<address@hidden> wrote:
> Hello Ben,
> Thank you for the answer. I used the area plot function, here a small
> example:
>
> Y = randn (4, 35040);
>
> area(Y)
> set(gca,"Layer","top")
> grid on
>
> print("test.tex","-dtex","-S1000,400");
>
> So I want to stack the different vectors on each other and color the areas
> in between. With this approach however the files are large. Up to 5MB.
> I just wondered if there is an technique to reduce the generated data,
> because in this way there's no use for a report due to much too large file
> sizes.
>
> Reza
>
> On Mon, Jan 16, 2012 at 2:40 PM, Ben Abbott <address@hidden> wrote:
>>
>> On Jan 16, 2012, at 4:20 AM, Reza Housseini wrote:
>>
>> > Hello Octave user,
>> >
>> > I try to print area plots with up to 35040 data points for the epslatex
>> > device. But the generated .ps file in latex is huge (7.5MB), due to the
>> > octave print output. I tried to adjust the resolution with the -r option 
>> > but
>> > this didn't work. Is there any other way to reduce the file size without
>> > manually reduce my input vector? There's no need that I see all the details
>> > over the 35040 points, is just to get the reader an impression of how the
>> > data looks like.
>> >
>> > Thanks a lot for the support,
>> >
>> > Best wishes,
>> > Reza
>>
>> Did you use the scattter() command to produce your plot ?  This command
>> produces a patch object for each data point and can produce a very large
>> file (and slow plot updates).
>>
>> If you used that, you can try the plot command instead. Depending upon
>> what you want that may take some extra effort, but you can start with ...
>>
>>        x = randn (1, 35040);
>>        y = randn (1, 35040);
>>        h = plot(x, y, "s");
>>        set (h, "markerfacecolor", "auto")
>>
>> Gnuplot's markers are  not implemented in a consistent way. So it may no
>> display as expected, but if you print it, you will get the expected result.
>>
>>        print -depsc test.eps
>>
>> Using my example, the file size is 549 kB.
>>
>> If my guess that you're using scatter() is not correct, please give us
>> more information. If possible a simple script that demonstrates the problem
>> would be helpful.
>>
>> Ben
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>

Hi Reza,

The example you provide is trying to plot  35040, areas delimited by 4
points. I guess you wanted it  the other way around, 4 lines delimited
by many points, right?
I know you want a solution that doesn't involve modifying your input
vectors. However, since it is very simple (assuming your data comes
from, at least,   a continuous function), you could reduce the size of
your vectors by interpolation before plotting, using the function
interp1.

You could also export as bitmap (with any resolution) and then include
it in an eps/pdf file or directly in latex.
http://en.wikibooks.org/wiki/LaTeX/Importing_Graphics#Including_graphics

That is the way I include the plots in this paper (if you do it
carefully it looks as good as vector)
http://arxiv.org/abs/1108.4432

My two cents.

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]