Improving the Plots in Blogger - Cost-effectiveness and Peak Datasets - Osculatory, Ellis/McLain, Akima, Butland, Modified Butland Methods
Blogger only allows upload of images, whereas I really want to include vector graphics. SVG would be ideal, but I have found a post on how to include PDF... so here goes. The post is:
https://sites.google.com/a/gapps.uwcsea.edu.sg/dover-primary-ict/resources/embed-a-pdf-into-blogger
The solution is as follows:
- Export the PDF from the R plot pane, with the required size
- Save the PDF in Google Drive
- Open the file in Google Drive (using Quick Actions in the Open menu)
- Select 'Embed item' from the vertical dots menu
- Copy and paste the iframe HTML code into the post in Blogger, making sure the post is in HTML mode, not Compose mode
- The PDF is then visible in Preview mode
To get a nice appearance, it has proved necessary to edit the height (here 2600) and width (here 460), using trial and error ;). I also combined the separate PDFs into one, using Mac OS Preview tool.
The datasets are as follows. The cost-effectiveness dataset is:
| x | 2.0 | 5.0 | 10.0 | 15.0 | 20.0 | 25.0 | 30.0 | 40.0 |
|---|---|---|---|---|---|---|---|---|
| y | 6.9 | 2.3 | 0.8 | 0.5 | 0.33 | 0.27 | 0.2 | 0.17 |
The peak data set is:
| x | 0.0 | 1.0 | 2.0 | 3.0 | 4.0 | 5.0 | 6.0 | 7.0 | 8.0 | 9.0 | 10.0 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| y | 1.0 | 1.1 | 1.1 | 1.2 | 1.3 | 7.2 | 3.1 | 2.6 | 1.9 | 1.7 | 1.6 |
Note that the 'Compose' editor in Blogger does not show the styling applied to the above tables - but looks OK in Preview mode (and when viewed).
Here is a sequence of plots for the different methods on the cost-effectiveness data set: Osculatory, Ellis/McLain, Akima, Butland and Modified Butland. The PDFs were exported as 5.35 x 5.88 inches, portrait style.
Here is a similar set for the peak data set:
Comments
Post a Comment