high resolution tiff of op plots #234
-
How can we generate a high resolution tiff of op plots? When op plots are generated and opened in the browser the resolution is fine. However, we cannot download a high resolution tiff or jpg (maybe due to IT restrictions?). Previously, one could generate and export the op plot pdfs and tiff within R. Can someone provide us with an idea. Maybe we just don't see it. Thanks a lot in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Here is a small example to show you how you can generate a plot manually using the data contained in the library(Pmetrics)
library(tidyverse)
library(ggpubr)
# Replace this with your OP-object from your result
op <- NPex$op$data
# Create the plot using `ggplot2`
op_plot = op %>%
filter(pred.type == "post") %>% # Filter for posterior predictions
filter(icen == "mean") %>% # Filter to use the mean of the posterior parameters, as opposed to the median
ggplot(aes(x = pred, y = obs)) +
geom_abline(slope = 1, intercept = 0, lty = "dashed", alpha = 0.5) + # Add a reference line
geom_point(pch = 21, col = "black", fill = "red") + # Red points with black outline
ggpubr::theme_pubr() + # Set the correct size for fonts
labs(x = "Predicted concentration", y = "Observed concentration") + # Add labels to X- and Y-axis
theme(aspect.ratio = 1) # OP-plots should always be shown with an aspect ratio of 1 !
# Look at the plot
op_plot # Save the plot as high-quality TIFF
ggsave(plot = op_plot, filename = "OP.tiff", height = 5, width = 5, dpi = 600) Created on 2024-07-17 with reprex v2.1.0 |
Beta Was this translation helpful? Give feedback.
-
Thank you for your quick response. It helped a lot and I used additional functions in ggplot to modify the plot. Sent from my iPhoneViele Grüße,Dr. Christina KönigClinical Pharmacist,Infections Diseases, Medication Management D-Tel.: +49 178 804 7557US-Cell: +1 (857) 340-0093On Jul 17, 2024, at 6:11 AM, Markus Hovd ***@***.***> wrote:
Here is a small example to show you how you can generate a plot manually using the data contained in the op-object of the PMresult. This example uses ggplot2 to create the figure, and saves it using ggsave.
library(Pmetrics)
library(tidyverse)
library(ggpubr)
# Replace this with your OP-object from your result
op <- NPex$op$data
# Create the plot using `ggplot2`
op_plot = op %>%
filter(pred.type == "post") %>% # Filter for posterior predictions
filter(icen == "mean") %>% # Filter to use the mean of the posterior parameters, as opposed to the median
ggplot(aes(x = pred, y = obs)) +
geom_abline(slope = 1, intercept = 0, lty = "dashed", alpha = 0.5) + # Add a reference line
geom_point(pch = 21, col = "black", fill = "red") + # Red points with black outline
ggpubr::theme_pubr() + # Set the correct size for fonts
labs(x = "Predicted concentration", y = "Observed concentration") + # Add labels to X- and Y-axis
theme(aspect.ratio = 1) # OP-plots should always be shown with an aspect ratio of 1 !
# Look at the plot
op_plot
# Save the plot as high-quality TIFF
ggsave(plot = op_plot, filename = "OP.tiff", height = 5, width = 5, dpi = 600)
Created on 2024-07-17 with reprex v2.1.0
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Thank you for your quick response. It helped a lot and I used additional functions in ggplot to modify the plot. Sent from my iPhoneViele Grüße,Dr. Christina KönigClinical Pharmacist,Infections Diseases, Medication Management D-Tel.: +49 178 804 7557US-Cell: +1 (857) 340-0093On Jul 17, 2024, at 6:11 AM, Markus Hovd ***@***.***> wrote:
Here is a small example to show you how you can generate a plot manually using the data contained in the op-object of the PMresult. This example uses ggplot2 to create the figure, and saves it using ggsave.
library(Pmetrics)
library(tidyverse)
library(ggpubr)
# Replace this with your OP-object from your result
op <- NPex$op$data
# Create the plot using `ggplot2`
op_plot = op %>%
filter(pred.type == "post") %>% # Filter for posterior predictions
filter(icen == "mean") %>% # Filter to use the mean of the posterior parameters, as opposed to the median
ggplot(aes(x = pred, y = obs)) +
geom_abline(slope = 1, intercept = 0, lty = "dashed", alpha = 0.5) + # Add a reference line
geom_point(pch = 21, col = "black", fill = "red") + # Red points with black outline
ggpubr::theme_pubr() + # Set the correct size for fonts
labs(x = "Predicted concentration", y = "Observed concentration") + # Add labels to X- and Y-axis
theme(aspect.ratio = 1) # OP-plots should always be shown with an aspect ratio of 1 !
# Look at the plot
op_plot
# Save the plot as high-quality TIFF
ggsave(plot = op_plot, filename = "OP.tiff", height = 5, width = 5, dpi = 600)
Created on 2024-07-17 with reprex v2.1.0
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Here is a small example to show you how you can generate a plot manually using the data contained in the
op
-object of thePMresult
. This example usesggplot2
to create the figure, and saves it usingggsave
.