Draw a & ldquo; arrow & rdquo; in the legend of a plot R

I have a "curve" and an upright positioned "arrow" in an R plot (see R code Below). I was wondering if it might be possible to show an actual arrow in the "legend" rather than a smooth, straight line to distinguish my arrow f

Interact with the graph on the web page

I want to plot a graph (diagram) on html pages, and the graph could consist of multiple nodes (sub-graph). When a user clicks a node, I need to display some textual message somewhere on the page. Is this can be done by some JavaScript plot library? A

A: Add arrows to layout grids

I'm using layout to plot multiple things and I'd like to add arrow between some of these plots. I tried grid.curve and grid.lines() but no luck so far. Here's an example of what I'd like to do: mat <- cbind(matrix(c(1:3,0,4:5,0,6,7),3,3,byrow=T), 8:1

How to use an arrow within the title of a parcel?

how can I use an right arrow inside the title of a barplot? I tried the following: counts <- c(0.2, 0.4) barplot(counts, main="A → B", horiz=TRUE, col=2:3, xlab="Time", xlim=c(0, 1.0)) In R the title of the plot looks good but when

Presentation of two curves in ggplot2

Is there a more efficient way to present these data in ggplot2? Ideally, I would like them both in one plot. I know this can be achieved in python with matlibplot, but I like the visuals of ggplot2 better. R code used to generate the plots: #load lib

Multiple plots on a page using ggplot

I have 12 plots generated by a loop and I want to plot them with 3 rows and 2 columns on one page (2 pages in total). I know how to do it in R pdf("1.pdf") par(mfrow = c(3, 2)) for (i in 1:12) { x <- 1:10 y <- 2*x + rnorm(x) plot(x, y) } d

add text to the right of the chart

here is my current code: vec2<- c(10.810811, 18.146718, 25.096525, 26.640927, 16.216216, 3.088803) b<-barplot(as.matrix(vec2), ylab = "Total Percentage", xlab="studies", col = c("red", "yellow", "green&qu

Plot least squares averages for factor level groups

I'm looking for a simple way to extract (and plot) the least-squares means of specified combinations of levels of one factor, for each level of another factor. Example data: set.seed(1) model.data <- data.frame(time = factor(paste0("day", rep

Parcels being cut in python notebook

I have been doing some experimenting at replacing my matplotlib plots using the plot.ly library inside the ipython notebook. Basically the problem I have is that plot.ly plots that are autosized don't look very good and I have tried to manually tweak

Use the axis () to draw the axis without the ticks

Given a plot without axes, I would like to use axis to add a horizontal axis. On the left hand side you see the given "baseline" plot, on the right hand side the desired result: The baseline plot is simply generated using plot(1, axes = FALSE, m

How to change the values ​​on the y-axis for lattice xyplot

I have an xy plot in lattice on which I'm showing four different things. The plot looks like this right now. The values for pink line range from 1 to 15000, however, values for other lines range from 20 to 300. This is why all lines other than pink s

Shade many different portions in ggplot2

This question builds on How can i provide shades between dates on x axis in R plot? and How to align multiple ggplot2 plots and add shadows over all of them. Before I go into details, I want to be able to condense the amount of code I would have to w

Add a name to the boxplot in R

This question is related to: R: how to label the x-axis of a boxplot When more than one column is plotted, names appear. But when only one column is plotted, name does not appear, even when names=.. argument is used: ddf = structure(list(apple = c(1,

igraphic plot in a large area

Just wondering if it is possible to increase the size of the plot so that the nodes and edges can be more scattered over the plot. Original plot: What are expected: I tried many parameters in the layout function such as area, niter, and so on, but al

How to crop the plot area to the exact range of your data in R?

When I set limits to a plot in R, there is some distance between the limits I set and the actual limits of the plot area: plot(c(1, 4), c(1, 4), ylim = c(1, 4)) Of course I can set the limits inside the outermost ticks so they appear to fall close to

Several curves with the same x-axis in R

Could-you help me please in solving this issue. In fact, i would like to plot multiple curves on the same graph on R with a x-axis which is time labeled. I tried this : dayTime = strptime(sapply(c(0:110)+480, function(x){paste(floor(x/60),":",x%

Creates titles for layout on the fly

I am looking for a simple way of giving titles to each field in a layout, like this: layout(matrix(1:8, nrow=2, ncol=4, byrow=TRUE)) # Graph matrix for (x in names(ftime.p)){ plot(listz$x$data) title(x) } Notice that in my case, length(listz) = 8 I t

MATLAB Graphical plots with axes

I have been trying to Create a program with the GUI in MATLAB. When I try to plot information with AXES I can not figure out how to do it. I know about the function plot, but I need to be able to re-size and move the plot around in the figure so I ca

Subplots of Matlab pressed

I try producing a 14 x 5 subplot in Matlab, however the subplots have square axes so when displayed the subplots are not legible. Similarly, when I plot the results to pdf, the subplots are too small to read. How can I prevent this problem?If you don

Constant bar width in a barplot array in R

I am trying to make a (1 row, 3 column) array of barplots that all have the same bar width. All three bar plots have a different number of observations and hence the width of the bars end up different for each plot (i.e. plot with the most observatio

Xkcd style graphics in MATLAB

So talented people have figured out how to make xkcd style graphs in Mathematica, in LaTeX, in Python and in R already. How can one use MATLAB to produce a plot that looks like the one above? What I have tried I created wiggly lines, but I couldn't g

Drawing mask above the MATLAB grayscale image

I'm running an algorithm to segment part of an image using morphological operations. I end up with a 2D binary image that represents the segmentation results. Namely, the mask. My question is how to plot the original image and the mask overlay in col

Removing points and lines from the MATLAB plot

I have a figure where the user can click into. The coordinates of the click will get stored in two vectors x and y. Than I plot the newly created point via plot(x_new, y_new) and further there's a context me nu being created for this point which has

R scale of the barplot axis

I want to plot a barplot of some data with some x-axis labels but so far I just keep running into the same problem, as the axis scaling is completely off limits and therefore my labels are wrongly positioned below the bars. The most simple example I

Add an arrow under the x-axis in R charts

I am trying to add arrows marking specific x coordinates below the x axis in an R plot. My x axis is at y=0 and when I try to use negative y-coordinates in arrows, so the arrows will be perpendicular to x axis, I get only the very edges of the arrow