Most voted "plot" questions
Plot in certain languages (Octave, Matlab, R) is a function used to draw graphics, which can be in 2D or 3D.
Learn more…91 questions
Sort by count of
-
11
votes1
answer266
viewsHow to create Needles chart in R?
I am trying to make a chart of Needles suggested in the Matter of Non-parametric Methods in the study of Histograms. I found a command called rug(), but it seems that the idea is not that.…
-
9
votes4
answers8280
viewsHow to put the regression line on a graph?
Suppose a linear regression model like the following: set.seed(1) x <- rnorm(100) y <- rnorm(100) + 2*x +10 modelo <- lm(y~x) If I plot y against x, how do I include the regression line in…
-
8
votes2
answers637
viewsHow to make a conditional y~x graph for each data.frame factor?
Suppose a data.frame like the following: set.seed(1) dados <- data.frame(w=rep(c("A", "B", "C", "D"), 50), y= rnorm(200), x=rnorm(200), stringsAsFactors=FALSE) How to create a chart y~x separated…
-
7
votes1
answer4682
viewsHow to create a Plot with 2 superimposed histograms?
Suppose I have the following data from 2 distinct groups. set.seed(1) grupo1<-rnorm(400,6,2) grupo2<-rnorm(200,8,2) How I make a histogram of the two groups on the same screen, identifying…
-
7
votes3
answers3287
viewsHow to put the regression equation on a graph?
On another question saw how to put the regression line on a graph. But, how to put the regression equation in the graph? For example: Or…
-
7
votes2
answers302
viewsConnecting the points to the regression line
Suppose the following database: Income <- structure(list(X = 1:30, Education = c(10, 10.4013377926421, 10.8428093645485, 11.2441471571906, 11.6454849498328, 12.0869565217391, 12.4882943143813,…
-
7
votes1
answer235
viewsPlot 3D figures for list data
I have a list a with three matrices and one vector v with any three frequencies (positive reals), these matrices form triangles through a function I created pplot. I wish to add vector information v…
-
5
votes1
answer3442
viewsHow to plot the estimated logistic regression model
Suppose I have the data below, apply a logistic regression to them and want to visualize the estimated function that returns the probability. #Simula os dados nobs<-100 beta0=-10 beta1=0.006…
-
5
votes1
answer10722
viewsHow to plot a line chart with different colors depending on the value?
Suppose the following data: set.seed(1) y<-rnorm(101) x<-seq(from=0, to=100,by=1) I want to make a Plot with a line that has different color for negative values. To make a chart of points just…
-
5
votes2
answers200
viewsHow do you store a chart as a variable and export it later?
Considering: x<-1:10 y<-10:1 plot(x,y) I would like to store the result of plot() in a variable, such as grafico<-plot(x,y) is it possible? And to export as I do?…
-
5
votes2
answers558
viewsHow to make concentric circles in r Plot
I need to make concentric circles, preferably displaced from the origin, in function plot() to serve as a visual reference to a function. I tried the abline(), but I was unsuccessful.…
-
5
votes1
answer3753
viewsHow to change the y-axis scale on a line chart
I’m trying to plot a graph where the points on the y-axis vary in decimal places but I couldn’t adjust the axis scale to vary in decimal places as well. t_mean = c(30.24, 30.73, 30.94, 31.97, 31.28,…
-
5
votes1
answer93
viewsHow to change the distance or rotation of the axis heading of a graph relative to the axis itself
I make the graphic below using the plot3D package of R. I would like to move the label a little away from the z axis ($f(y_{1},y_{2})$) of the values of the axis or leave it horizontal. Does anyone…
-
4
votes1
answer1187
viewsHow to delete axis title in graphics in R?
I am doing multiple regressions for the same variable X and filling together using the command par(mfrow) in the R. But I want to put only one title on the X axis at the end of all my charts. I…
-
4
votes1
answer97
viewsGgplot of a Data.frame in separate graphs
I have that date.frame: > df ind m X1 X2 1 2015-12-21 21 0.1431529 0.1426365 2 2015-12-21 42 0.1403679 0.1443714 3 2015-12-21 63 0.1467133 0.1466899 4 2015-12-21 84 0.1513388 0.1485589 5…
-
4
votes1
answer271
viewsQuadratic Curve Estimating Minimum Square using R
I have a quadratic model that I want to run a simple multivariate regression using Minimal Ordinary Squares. This is my code: df<-data.frame(rnorm(50),rnorm(50)) x_Square<-df[,2]^2…
-
4
votes1
answer625
viewsGraph of columns of a Data Frame using GGPLOT
I have that date.frame: A K1 B K2 C K3 D K4 E K5 1 0.89386498 0.239258200 -0.004970278 0.99477685 -0.243845617 0.80370370 0.3132989 0.637155451 -0.55467576 0.049341476 2 0.35422172 0.681622485…
-
4
votes1
answer1316
viewsJoin 3 graphs using Plot
I want to join the three graphs below using the function plot. I do the basics starting with the command par(mfrow=c(1,3)) but I can’t get them together. The problem I believe is the fact that I’m…
-
4
votes1
answer279
viewsBuild Accumulated Density Probability using R
I have this two-column date frame (Y and X) With the package quantreg I can estimate the amounts of Y given x. Done this I’m not managing to build the CUMULATIVE Y conditional density function.…
-
4
votes1
answer256
viewsHow to play a graph that was created with the Plot command using ggplot2?
How to play the chart below using the ggplot2? I don’t know how to add the various charts into one layer single! bs<-function(t,mu,phi){…
-
4
votes1
answer60
viewsPlot Main Title with Text and formula y = a + betaX + Epsilon
This is the data: a=structure(c(2.96898844129164, 2.7849952585919, 2.4022019576164, 2.97749332978932, 3.23431466394159, 3.37620019711505, 3.3295390792587, 3.11646532271242, 2.84000702738219,…
-
4
votes1
answer2685
viewsHow to color the legend according to the chart in R
Hello guys I have a chart on R and would like to make the caption equal to the chart. follows below the command used and the graphic image. control = c(100,100,100,100,100) dez = c(100,90,0,0,0)…
-
4
votes2
answers158
viewsPlay a chart in R
I made graph 1 below in R, from the code: library(truncreg) set.seed(1) x <- sort(rnorm(50)+3) y <- 3 + 1*x + rnorm(50,0,0.3) compl <- data.frame(x,y) y[y>6.5] <- 6.5 sample <-…
-
4
votes1
answer113
viewsLine segments leaving the interior of a map of brazil using package ggrepel
I am trying to reproduce the format of the map below, however, I have been facing some problems to insert these "straights" on the map. After a search, I found the package ggrepel that brings with…
-
3
votes2
answers412
viewsConnecting dots to the 3d regression line
This is the 3d version of this other question. Consider the following data: Income2<-structure(list(X = 1:30, Education = c(21.5862068965517, 18.2758620689655, 12.0689655172414, 17.0344827586207,…
-
3
votes1
answer1401
viewsUsing function to make a subset and plot with only 1 command (R)
My dataframe calls EWMA_SD252 3561 Obs. of 102 variables (daily volatilities of 100 shares since 2000), follows a sample : Data IBOV ABEV3 AEDU3 ALLL3 3000 2012-02-09 16.88756 15.00696 33.46089…
-
3
votes1
answer493
viewsHow to turn plot of scatter into density?
I would like to know how to turn a dot dispersion graph into a dot density graph in the region, for example, where there are few dots the color of the region will be clear, where there are many dots…
-
3
votes1
answer99
viewsuse of Sys.Sleep
I can’t make a point-to-point graph, the R plot the graph then stays in the count of the Sys.sleep, someone help me? n=1 Cn=6.45 x<-3 t<- seq(1,20) for (i in 1:21) { flux = round(Cn*sin(n*pi*x…
-
3
votes1
answer82
viewsGraph of Conditional Densities of a Linear Regression
I have this data frame with two columns: Y and X. data=structure(list(Y = c(NA, -1.793, -0.642, 1.189, -0.823, -1.715, 1.623, 0.964, 0.395, -3.736, -0.47, 2.366, 0.634, -0.701, -1.692, 0.155, 2.502,…
-
3
votes1
answer85
viewsColoring a map with differing color intensity in ggplot2
I’m trying to create the Plot of a color map of Brazil with a specific color, the "#2D3E50". However, using this color on the map to color from the smallest area (light shade) to the largest area…
-
2
votes2
answers13721
viewsChange the X-axis scale
Hello, I’m trying to make a chart of thinning the trunk of a tree, where the y axis is the height (meters) and the x axis is the diameter (cm). So far no problem, but I would like to change the…
-
2
votes1
answer252
viewsmultiple columns using geom_lines ggplot
I have this data frame: structure(list(`Exchange Rate` = c(-0.145442175, 0.291096141, 0.489923112, -2.038363166, 1.180430664, 0.188114666, 0.850922634, 1.172142766, -3.980837975, 0.285762444,…
-
2
votes1
answer1011
viewsHow to remove caption in Plot?
How can I remove the caption that is automatically generated in the function plot package drc? plot(curva5r, ylab= "Dose (%)", xlab = "Dose (g.e.a. de glyphosate ha-1)") Note that the caption is on…
-
2
votes1
answer1063
viewsHow to add margins and text to the chart (Plot)?
I would like to know how to remove lines from the chart’s margins on the chart itself R (ex: image 1) and add the correlation value of the modelled curve with the coefficient of determination (R²).…
-
2
votes1
answer225
viewsProblem when plotting with ggplot2 R
I am trying to plot a graph in R to display the maximum and minimum values of some variables beyond a line to mark the 0 of y, however the points of the graph come out completely out of order. I am…
-
2
votes1
answer526
viewsAdd error bar on graph in R
I’m trying to plot a graph but I’m not able to add the error bars with the function arrow. I don’t know what could be wrong with the code below: m12<-plot(tq1_mean~time ,type ="p", col = "red",…
-
2
votes1
answer70
viewsChart with captions overlaid in R [without using ggplot2
Hello, my chart is getting some overlapping values, already tried to increase the chart not solved. library(RColorBrewer) #cores cor = brewer.pal(12, "BuPu") gen =c(1, 130, 2, 31, 1 ) labs_g =c(…
-
2
votes1
answer391
viewsHow can a colormap of a surface be mapped to a scalar function?
Translation of question I asked in the OR: I have a scalar function that represents the electrical potential on a spherical surface. I want to plot , for a given radius, the surface and map its…
-
2
votes2
answers233
viewsPlot time series on defined scale
I have a time series record, and I’m having trouble plotting on an appropriate scale. Take this example: #Gerar sinal v1 v1=sin(seq(from=0, to=3*2*pi, length=11060)) #Gerar sinal v2…
-
2
votes1
answer243
viewsRepresent the x-axis of the histogram as the frequency distribution classes?
I’m having problems when I’m doing a histogram of this frequency distribution. Class Limits f Rf Rf(%) cf(%) [22.691,25.57) 17 0.01 1.29 17 1.29 [25.57,28.45) 25 0.02 1.90 42 3.19 [28.45,31.33) 64…
-
2
votes1
answer101
viewsHow to save a rpart.Plot chart?
I am working with Décision Tree and at the end I have the chart that represents it. However, as it is a different object from other types of the ggplot or ggpubr family, I am not able to save by the…
-
2
votes1
answer121
viewsHow to plot two geom_line (one from each group) into a single Plot in ggplot2
I have 2 dfs (one from each group) that correspond to 76 channels of signal acquisition in 20sec. of analysis. To decrease the work of repeating several times (76x) the geom_line function I stacked…
-
2
votes1
answer699
viewsPlot of lines with months on the x-axis in ggplot - R
I’m taking R classes and an exercise came up to make a chart of lines on ggplot2 with data of flight delays per airport. On the X axis should stay the months (which are in numbers), but when…
-
2
votes1
answer56
viewsError when colorizing bar graph and caption with the pal.bands function
I’m trying to reproduce the chart below: However, I am not able to color my chart through the function pal.bands according to the information that is in the spreadsheet below: The data is found in…
-
2
votes0
answers27
viewsHow to count the quantity in variable using boxplot, not the frequency?
I’m trying to create a boxplot of the amount of respirators per state, but when I plot the R counts the frequency of respirators not the amount per state. There I have the following information: I…
-
2
votes1
answer28
viewsOverlay the legend of the estimated lines using the stat_poly_eq function
I adjusted different models considering the response variable (massaseca) as a function of (time) for each treatment level (content) using the ggplot2 package combined with the stat_poly_eq…
-
2
votes2
answers63
viewsCreate hatched area below normal distribution curve in R
I would like to create a gray hatched area, just like the one in the image below. I plotted the curve, with the data as follows: dados <- c(149.3355, 140.3779, 145.7254, 149.8931, 139.6168,…
-
1
votes1
answer625
viewsCenter a Plot on top of an image in Matlab
I’m crowding over an image, however with the code below the Plot happens at the beginning of the image at 0.0. I would like it to be done from the centre of the image in question. Excerpt from the…
-
1
votes1
answer1090
viewsadd accents to gnuplot
How do I place accent on gnuplot x and y axis caption? I’ve tried ascii coding but it doesn’t work # Rótulo do eixo x set xlabel "Iteracoes" font "Helvetica,20" I need the word to be "interactions"…
plotasked 7 years, 7 months ago Julia Campos 157 -
1
votes1
answer124
viewsPlot of the degree distribution of a graph in R
I have a graph and I want to plot the degree distribution. Example: > library(igraph) > g <- make_ring(10) > degree(g) [1] 2 2 2 2 2 2 2 2 2 2 > g2 <- sample_gnp(1000, 10/1000)…