Output formatting in PDF

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Output formatting in PDF

Preetam Pal
Hi,

Can you please help me with the following output formatting:
I am planning to include 2 plots and some general description in a one-page
PDF document, such that

   - I'll leave some appropriate margin on the PDF- say, 1.5 inches
   top,right, bottom and left (will decide based on overall appearance)
   - the 2 plots are placed side-by-side (looks best for comparison)
   - the margins for each plot can be 4 lines on the top and the bottom &
    2 lines on the left and the right
   - each of these 2 plots would have time (0 to 260) along x-axis and two
   time-series (daily USD-GBP and USD-EUR FX rates) on the y-axis, i.e. 2
   time-series would be plotted on each of the 2 graphs. I would need a
   different color for each plot to demarcate them
   - I need to add some text (eg: "Independent analysis of Exchange Rate
   dynamics") with reduced font size (not high priority though-just good to
   have a different size)
   - The general discussion (may be a paragraph) would come right below the
   2 plots - I can specify this text as an argument in a function, may be. I
   am not sure how to arrange the entire PDF as per the format I mentioned
   above

I shall really appreciate any help with this - the time series analysis is
not difficult, I can manage that - however, I don't know how to manage the
formatting part though, so that the 1-pager output looks decently
presentable. Thanks.

Regards,
Preetam

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Output formatting in PDF

Enrico Schumann-2
On Tue, 11 Oct 2016, Preetam Pal <[hidden email]> writes:

> Hi,
>
> Can you please help me with the following output formatting:
> I am planning to include 2 plots and some general description in a one-page
> PDF document, such that
>
>    - I'll leave some appropriate margin on the PDF- say, 1.5 inches
>    top,right, bottom and left (will decide based on overall appearance)
>    - the 2 plots are placed side-by-side (looks best for comparison)
>    - the margins for each plot can be 4 lines on the top and the bottom &
>     2 lines on the left and the right
>    - each of these 2 plots would have time (0 to 260) along x-axis and two
>    time-series (daily USD-GBP and USD-EUR FX rates) on the y-axis, i.e. 2
>    time-series would be plotted on each of the 2 graphs. I would need a
>    different color for each plot to demarcate them
>    - I need to add some text (eg: "Independent analysis of Exchange Rate
>    dynamics") with reduced font size (not high priority though-just good to
>    have a different size)
>    - The general discussion (may be a paragraph) would come right below the
>    2 plots - I can specify this text as an argument in a function, may be. I
>    am not sure how to arrange the entire PDF as per the format I mentioned
>    above
>
> I shall really appreciate any help with this - the time series analysis is
> not difficult, I can manage that - however, I don't know how to manage the
> formatting part though, so that the 1-pager output looks decently
> presentable. Thanks.
>
> Regards,
> Preetam

If using LaTeX is an option, I would suggest
?Sweave. There are many tutorials on the web that
should get you started.


--
Enrico Schumann
Lucerne, Switzerland
http://enricoschumann.net

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Output formatting in PDF

Preetam Pal
Hey Enrico,
LaTex is not possible actually.

On Tue, Oct 11, 2016 at 2:29 PM, Enrico Schumann <[hidden email]>
wrote:

> On Tue, 11 Oct 2016, Preetam Pal <[hidden email]> writes:
>
> > Hi,
> >
> > Can you please help me with the following output formatting:
> > I am planning to include 2 plots and some general description in a
> one-page
> > PDF document, such that
> >
> >    - I'll leave some appropriate margin on the PDF- say, 1.5 inches
> >    top,right, bottom and left (will decide based on overall appearance)
> >    - the 2 plots are placed side-by-side (looks best for comparison)
> >    - the margins for each plot can be 4 lines on the top and the bottom &
> >     2 lines on the left and the right
> >    - each of these 2 plots would have time (0 to 260) along x-axis and
> two
> >    time-series (daily USD-GBP and USD-EUR FX rates) on the y-axis, i.e. 2
> >    time-series would be plotted on each of the 2 graphs. I would need a
> >    different color for each plot to demarcate them
> >    - I need to add some text (eg: "Independent analysis of Exchange Rate
> >    dynamics") with reduced font size (not high priority though-just good
> to
> >    have a different size)
> >    - The general discussion (may be a paragraph) would come right below
> the
> >    2 plots - I can specify this text as an argument in a function, may
> be. I
> >    am not sure how to arrange the entire PDF as per the format I
> mentioned
> >    above
> >
> > I shall really appreciate any help with this - the time series analysis
> is
> > not difficult, I can manage that - however, I don't know how to manage
> the
> > formatting part though, so that the 1-pager output looks decently
> > presentable. Thanks.
> >
> > Regards,
> > Preetam
>
> If using LaTeX is an option, I would suggest
> ?Sweave. There are many tutorials on the web that
> should get you started.
>
>
> --
> Enrico Schumann
> Lucerne, Switzerland
> http://enricoschumann.net
>



--
Preetam Pal
(+91)-9432212774
M-Stat 2nd Year,                                             Room No. N-114
Statistics Division,                                           C.V.Raman
Hall
Indian Statistical Institute,                                 B.H.O.S.
Kolkata.

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Output formatting in PDF

Jeff Newmiller
In reply to this post by Enrico Schumann-2
Or package "knitr". Note that knitr can be used with LaTeX or markdown syntax, but from your description the former would be advised.
--
Sent from my phone. Please excuse my brevity.

On October 11, 2016 1:59:59 AM PDT, Enrico Schumann <[hidden email]> wrote:

>On Tue, 11 Oct 2016, Preetam Pal <[hidden email]> writes:
>
>> Hi,
>>
>> Can you please help me with the following output formatting:
>> I am planning to include 2 plots and some general description in a
>one-page
>> PDF document, such that
>>
>>    - I'll leave some appropriate margin on the PDF- say, 1.5 inches
>>    top,right, bottom and left (will decide based on overall
>appearance)
>>    - the 2 plots are placed side-by-side (looks best for comparison)
>>    - the margins for each plot can be 4 lines on the top and the
>bottom &
>>     2 lines on the left and the right
>>    - each of these 2 plots would have time (0 to 260) along x-axis
>and two
>>    time-series (daily USD-GBP and USD-EUR FX rates) on the y-axis,
>i.e. 2
>>    time-series would be plotted on each of the 2 graphs. I would need
>a
>>    different color for each plot to demarcate them
>>    - I need to add some text (eg: "Independent analysis of Exchange
>Rate
>>    dynamics") with reduced font size (not high priority though-just
>good to
>>    have a different size)
>>    - The general discussion (may be a paragraph) would come right
>below the
>>    2 plots - I can specify this text as an argument in a function,
>may be. I
>>    am not sure how to arrange the entire PDF as per the format I
>mentioned
>>    above
>>
>> I shall really appreciate any help with this - the time series
>analysis is
>> not difficult, I can manage that - however, I don't know how to
>manage the
>> formatting part though, so that the 1-pager output looks decently
>> presentable. Thanks.
>>
>> Regards,
>> Preetam
>
>If using LaTeX is an option, I would suggest
>?Sweave. There are many tutorials on the web that
>should get you started.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Output formatting in PDF

Dominik Schneider
In reply to this post by Preetam Pal
You may be able to do everything you need with the cowplot package.

On Tue, Oct 11, 2016 at 4:26 AM, Preetam Pal <[hidden email]> wrote:

> Hey Enrico,
> LaTex is not possible actually.
>
> On Tue, Oct 11, 2016 at 2:29 PM, Enrico Schumann <[hidden email]>
> wrote:
>
> > On Tue, 11 Oct 2016, Preetam Pal <[hidden email]> writes:
> >
> > > Hi,
> > >
> > > Can you please help me with the following output formatting:
> > > I am planning to include 2 plots and some general description in a
> > one-page
> > > PDF document, such that
> > >
> > >    - I'll leave some appropriate margin on the PDF- say, 1.5 inches
> > >    top,right, bottom and left (will decide based on overall appearance)
> > >    - the 2 plots are placed side-by-side (looks best for comparison)
> > >    - the margins for each plot can be 4 lines on the top and the
> bottom &
> > >     2 lines on the left and the right
> > >    - each of these 2 plots would have time (0 to 260) along x-axis and
> > two
> > >    time-series (daily USD-GBP and USD-EUR FX rates) on the y-axis,
> i.e. 2
> > >    time-series would be plotted on each of the 2 graphs. I would need a
> > >    different color for each plot to demarcate them
> > >    - I need to add some text (eg: "Independent analysis of Exchange
> Rate
> > >    dynamics") with reduced font size (not high priority though-just
> good
> > to
> > >    have a different size)
> > >    - The general discussion (may be a paragraph) would come right below
> > the
> > >    2 plots - I can specify this text as an argument in a function, may
> > be. I
> > >    am not sure how to arrange the entire PDF as per the format I
> > mentioned
> > >    above
> > >
> > > I shall really appreciate any help with this - the time series analysis
> > is
> > > not difficult, I can manage that - however, I don't know how to manage
> > the
> > > formatting part though, so that the 1-pager output looks decently
> > > presentable. Thanks.
> > >
> > > Regards,
> > > Preetam
> >
> > If using LaTeX is an option, I would suggest
> > ?Sweave. There are many tutorials on the web that
> > should get you started.
> >
> >
> > --
> > Enrico Schumann
> > Lucerne, Switzerland
> > http://enricoschumann.net
> >
>
>
>
> --
> Preetam Pal
> (+91)-9432212774
> M-Stat 2nd Year,                                             Room No. N-114
> Statistics Division,                                           C.V.Raman
> Hall
> Indian Statistical Institute,                                 B.H.O.S.
> Kolkata.
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Output formatting in PDF

Duncan Mackay-4
In reply to this post by Preetam Pal
Hi

There is also the basic option of using the grid package and viewports.
You can then place the plots where you want and annotate them

    pdf(file    = paste0("01", ".pdf"),
        height  = 3.5,
        width   = 7,
        paper   = "special",
        onefile = TRUE,
        family  = "Helvetica",
        pointsize = 12,
        colormodel = "rgb")
       
    vpl <- viewport(x = 0.25, y = 0.5, width = 0.45, height = 0.9)
    pushViewport(vpl)
    grid.rect(gp = gpar(lty = "dashed"))
    popViewport()

    vpr <- viewport(x = 0.75, y = 0.5, width = 0.45, height = 0.9)
    pushViewport(vpr)
    grid.rect(gp = gpar(lty = "dashed"))
    grid.circle(x = 0.6, y = 0.4, r = 0.3)
    popViewport()
   
    dev.off()

In your case you may need to have a viewport of the whole page

see  http://www.amstat.org/publications/jse/v18n3/zhou.pdf for examples

also have a look at the grid.clip function

Regards

Duncan Mackay

Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: [hidden email]


-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Preetam Pal
Sent: Tuesday, 11 October 2016 19:14
To: [hidden email]
Subject: [R] Output formatting in PDF

Hi,

Can you please help me with the following output formatting:
I am planning to include 2 plots and some general description in a one-page
PDF document, such that

   - I'll leave some appropriate margin on the PDF- say, 1.5 inches
   top,right, bottom and left (will decide based on overall appearance)
   - the 2 plots are placed side-by-side (looks best for comparison)
   - the margins for each plot can be 4 lines on the top and the bottom &
    2 lines on the left and the right
   - each of these 2 plots would have time (0 to 260) along x-axis and two
   time-series (daily USD-GBP and USD-EUR FX rates) on the y-axis, i.e. 2
   time-series would be plotted on each of the 2 graphs. I would need a
   different color for each plot to demarcate them
   - I need to add some text (eg: "Independent analysis of Exchange Rate
   dynamics") with reduced font size (not high priority though-just good to
   have a different size)
   - The general discussion (may be a paragraph) would come right below the
   2 plots - I can specify this text as an argument in a function, may be. I
   am not sure how to arrange the entire PDF as per the format I mentioned
   above

I shall really appreciate any help with this - the time series analysis is
not difficult, I can manage that - however, I don't know how to manage the
formatting part though, so that the 1-pager output looks decently
presentable. Thanks.

Regards,
Preetam

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.