plot

Output graph to a two page PDF

↘锁芯ラ 提交于 2021-02-20 10:07:43
问题 I am doing a forest plot and want to save it to a PDF file. My forest plot is oversize (8in*20in). It can fit in a one page PDF like this: dev.print(pdf, file="C:\\Work\\plot.pdf", width=8, height=20); But then it is too long: When I print this PDF on a A4 paper, it has to be shrinked to fit the paper. So I want to save it to a two-page PDF file (from R). Ps: it is not a question about how to set the printer. How to do this? 回答1: So, you are able to generate an 8in x 20in == 203.2mm x 508mm =

How can I put a degree symbol (º) on an OpenCv Video?

孤街浪徒 提交于 2021-02-20 04:07:49
问题 I made a program which make a HUD over a video, getting info from sensors and plotting the results on the video frames, refreshing every frame, and for representing degrees (inclination) I need to plot a degree symbol, but what I get it's 2 symbols ("??") in the video show. I search through this site and others too. I can't do it!!!! please, I don't know what to do, it's just that little thing that I can't do it. This is the beginning of my program: import cv2 from random import * import

LOCF and NOCF methods for missing data: how to plot data?

淺唱寂寞╮ 提交于 2021-02-20 03:50:21
问题 I'm working on the following dataset and its missing data: # A tibble: 27 x 6 id sex d8 d10 d12 d14 <dbl> <chr> <dbl> <dbl> <dbl> <dbl> 1 1 F 21 20 21.5 23 2 2 F 21 21.5 24 25.5 3 3 NA NA 24 NA 26 4 4 F 23.5 24.5 25 26.5 5 5 F 21.5 23 22.5 23.5 6 6 F 20 21 21 22.5 7 7 F 21.5 22.5 23 25 8 8 F 23 23 23.5 24 9 9 F NA 21 NA 21.5 10 10 F 16.5 19 19 19.5 # ... with 17 more rows I would like to fill the missiningness data via the Last Observation Carried Forward method (LOCF) and the Next

LOCF and NOCF methods for missing data: how to plot data?

戏子无情 提交于 2021-02-20 03:49:20
问题 I'm working on the following dataset and its missing data: # A tibble: 27 x 6 id sex d8 d10 d12 d14 <dbl> <chr> <dbl> <dbl> <dbl> <dbl> 1 1 F 21 20 21.5 23 2 2 F 21 21.5 24 25.5 3 3 NA NA 24 NA 26 4 4 F 23.5 24.5 25 26.5 5 5 F 21.5 23 22.5 23.5 6 6 F 20 21 21 22.5 7 7 F 21.5 22.5 23 25 8 8 F 23 23 23.5 24 9 9 F NA 21 NA 21.5 10 10 F 16.5 19 19 19.5 # ... with 17 more rows I would like to fill the missiningness data via the Last Observation Carried Forward method (LOCF) and the Next

python 1/x plot scale formatting, tick position

≯℡__Kan透↙ 提交于 2021-02-20 03:47:28
问题 I have plotted some data with Python and tried to change the ticks with FuncFormatter . Now I want to change the segmentation into round numbers. I also want minor ticks in the same formation, in my case it would be a 1/x segmentation. I want the scaling to spread. The pictures will help you to imagine my issue. import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as tick x = np.array([805.92055,978.82006,564.88627,813.70311,605.73361,263.27184,169.40317]) y = np.array(

python 1/x plot scale formatting, tick position

守給你的承諾、 提交于 2021-02-20 03:45:39
问题 I have plotted some data with Python and tried to change the ticks with FuncFormatter . Now I want to change the segmentation into round numbers. I also want minor ticks in the same formation, in my case it would be a 1/x segmentation. I want the scaling to spread. The pictures will help you to imagine my issue. import numpy as np import matplotlib.pyplot as plt import matplotlib.ticker as tick x = np.array([805.92055,978.82006,564.88627,813.70311,605.73361,263.27184,169.40317]) y = np.array(

Restrict fitted regression line (abline) to range of data used in model

﹥>﹥吖頭↗ 提交于 2021-02-19 23:44:20
问题 Is it possible to draw an abline of a fit only in a certain range of x-values? I have a dataset with a linear fit of a subset of that dataset: # The dataset: daten <- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2)) # make a linear fit for the datapoints 3, 4, 5 daten_fit <- lm(formula = y~x, data = daten, subset = 3:5) When I plot the data and draw a regression line: plot (y ~ x, data = daten) abline(reg = daten_fit) The line is drawn for the full range of x-values in the

Restrict fitted regression line (abline) to range of data used in model

拥有回忆 提交于 2021-02-19 23:39:06
问题 Is it possible to draw an abline of a fit only in a certain range of x-values? I have a dataset with a linear fit of a subset of that dataset: # The dataset: daten <- data.frame(x = c(0:6), y = c(0.3, 0.1, 0.9, 3.1, 5, 4.9, 6.2)) # make a linear fit for the datapoints 3, 4, 5 daten_fit <- lm(formula = y~x, data = daten, subset = 3:5) When I plot the data and draw a regression line: plot (y ~ x, data = daten) abline(reg = daten_fit) The line is drawn for the full range of x-values in the

Formatting X axis with dates format Matplotlib

佐手、 提交于 2021-02-19 08:35:08
问题 I have written code which plots the past seven day stock value for a user-determined stock market over time. The problem I have is that I want to format the x axis in a YYMMDD format. I also don't understand what 2.014041e7 means at the end of the x axis. Values for x are: 20140421.0, 20140417.0, 20140416.0, 20140415.0, 20140414.0, 20140411.0, 20140410.0 Values for y are: 531.17, 524.94, 519.01, 517.96, 521.68, 519.61, 523.48 My code is as follows: mini = min(y) maxi = max(y) minimum = mini -

How do you set the color palette so that it starts with the darkest color, where older data being lighter than current

本小妞迷上赌 提交于 2021-02-19 07:37:27
问题 I'm plotting a correlation scatter plot, where my data frame has time data and the start year is arbitrary. In this case now I have the following R code ## Set seed for randomness in dummy data: ## set.seed(123) ## Create data frame: ## df.Data <- data.frame(date = seq(as.Date('2019-01-01'), by = '1 day', length.out = 650), DE = rnorm(650, 2, 1), AT = rnorm(650, 5, 2)) corPearson <- cor.test(x = df.Data$DE, y = df.Data$AT, method = "pearson") df.Data$year <- format(as.Date(df.Data$date), '%Y'