Displaying 20 results from an estimated 4000 matches similar to: "Find a rectangle of maximal area"
2008 Oct 19
1
convert lines to inches
Hi,
how can I convert the unit "lines" of par("mar") into inches?
par("mai") could help, but does not (see code below).
I want to plot a curve in a predefined size in pdf (I add some margin
space to the plot width&height, everything is in cm):
pdf("test.pdf",width=(20+2+4)/2.54,height=(10+3+1)/2.54)
plot(10:30,
2009 Nov 12
2
Non linear programming optimization (which package to use?)
Hello,
1) Is there any nonlinear programming optmizer that I can user for the
following problem?
Obj function: (max) revenue = price * volume
Constraints: price and volume pair must be from the following variable data set:
Variable data set:
# price volume
1 10 500
2 20 450
3 30 330
4 40 250
5 50 190
Expected result: 10,000 (variable row#4)
2) Could it also be possible for the suggested
2010 Jan 15
3
optimization problem
Dear R-experts,
this is not a direct R-problem but I hope you can help me anyway.
I would like to minimize || PG-I || over P, where P is a p x p permutation matrix (obtained by permuting the rows and/or columns of the identity matrix), G is a given p x p matrix with full rank and I the identity matrix. ||.|| is the frobenius norm.
Does anyone know an algorithm to solve such a problem? And if
2011 Oct 08
2
[R ]Plot a colored rectangle under the points of a graph
Hello everyone,
if I have:
x=1:10
y=1:10
plot(x,y)
and I plot a rectangle
rect(4,0,6,11, col=5)
it covers the points of the graph.
Is there a way to draw the rectangle under the points?
I was thinking the a solution could be draw an empty plot
then draw the rectangle and after the points,
but it did not work.
Any idea?
thanks for your help
H.
[[alternative HTML version deleted]]
2004 Dec 14
2
drawing a rectangle through multiple plots
How do I draw a rectangle across multiple plots on a device?
E.g.,
def.par <- par(no.readonly = TRUE)
par(mfrow = c(3, 1))
plot(1:10, rnorm(10), ylim = c(-4,4), type = "l")
plot(1:10, rnorm(10), ylim = c(-4,4), type = "l")
plot(1:10, rnorm(10), ylim = c(-4,4), type = "l")
rect(2, -4, 3, 4)
par(def.par)
I want the rectangle to extend across the whole device. How
2007 Jan 24
2
modify rectangle color from image
Hi,
I need some suggestion on how I could modify the color on some
rectangle that I have created using "image".
In other words, I have a 5x5 matrix, say, m.
m <- matrix(rnorm(25), nrow=5)
I create a grid of rectangles by:
image(m)
Now I want to change the color of rectangle (3,3) to blue.
I don't know how this could be done, and searching the web has
2006 Jul 29
3
placing rectangle behind plot
I am trying to create a lattice plot and would like to later, i.e. after
the plot is drawn, add a grey rectangle behind a portion of it.
The following works except that the rectrangle is on top of and
obscures a portion of the chart. I also tried adding col = "transparent"
to the gpar list but that did not help -- I am on windows and
perhaps the windows device does not support
2004 Dec 02
2
Drawing a rectangle around a barplot()
Hi
I want to draw a rectangle behind a barplot such that it highlights
those particular bars from the rest of the plot. I have figured out how
to draw a barplot(), and then how to draw a rectangle of the correct
shape and size (using rect()), but when I use rect() it draws over the
top of the bars, and then when I re-draw the bars, it draws with a white
background, thus eliminating my rectangle!
2008 Apr 08
2
diagonally fill a rectangle with color gradient
Hi,
Is it possible to diagonally fill a rectangle with a color gradient? I
noticed that the gradient.rect of plotrix could fill a rect either up and
down or from side to side. I am looking for something similar but fills
diagonally instead, e.g., from the upper left corner to the bottom right.
Does anyone know how to do it in R?
Thanks,
--
Tom
[[alternative HTML version deleted]]
2008 Jul 26
1
the C function drawing a rectangle: heatmap() -> image() -> do_image() -> GRect() -> GERect() -> rect() -> do_rect() -> GRect() ??
Hello anyone used to do similar things: search for the final C function that corresponding to the drawing of a rectangle?
As listed in the subject, I started from heatmap() in R and after several steps reached the GRect() in C. However, then it refers to rect() which further seems to refer to do_rect(), and then, surpringly, do_rect refers to GRect()!!! A dependency circle! How can it work if no
2006 Jun 04
1
text bubble (rectangle)?
Dear R wizards: sorry to bug everyone twice in one day.
I would like to annotate my graph by putting text strings into
rectangle boxes with a little cartoon-like bubble with a lid pointing
to a specific location. I can draw some sort of bubble-with-lid using
the R primitives. (has anyone done something like this already?)
the problem where I am stuck is that the width of the rectangle must
2008 Feb 27
2
Add a rectangle behind a plot
Hi there,
I found one reference to add a reactangle behind a
plot using plot(...,add=T), I tried this but didn't
obtain the desired result.
If a I have the following code:
plot(x,y)
rect(xleft, ybottom, xright,ytop,col='green)
The rectangle appear on top of the plot.
Any help will be greatly appreciated,
Judith
2009 May 23
1
Draw a rectangle on top of an image using RGtk2?
Dear all,
I use gtkImageFromFile to display an image. Then I want to do some
gsignal to handle mouse event. I click the mouse and move a another
position and release. I can get the position of the firs click and the
release position, then I would to draw a rectangle to display the
region I have selected. I need some hints on what functions should I
look for. I tried to google but don't know
2009 Apr 14
1
Lattice xyplot: Line and Rectangle in legend.
Hello fellow R users,
I have a problem. I have created a barchart overlayed by an xyplot line,
both of which read off the same Y axis. The problem comes when I try to
generate a key. It seems that I can only create either two lines, or two
rectangles. I would much prefer to have the barchat series depicted by a
rectangle, and the xyplot series by a line. Is there a way to do this?
Your help
2006 Mar 28
1
How to remove the outer rectangle in 3D plot/surface.
Hello,
I plot a 3D plot/surface using cloud function in lattice package.
Several days ago, I post a question about
how to remove the framebox out the 3D plot/surface.
However, I think I don't make me understood clearly.
I just hope to romove the outer rectangle or box around the box.
Thanks again.
Regards,
Jinsong Zhao
2008 Oct 16
1
draw a 5cm x 3cm rectangle
Hi I want to draw sth in a pdf file with a predefined defined size.
Say a 5cm x 3cm rectangle (a ruler):
pdf("rect.pdf", paper="a4")
plot(c(1,5,5,1,1),c(1,1,3,3,1),asp=1,axes="n")
dev.off()
but how do I fix that one unit is 1cm?
Thanks
thomas
2012 Sep 28
2
changing outlier shapes of boxplots using lattice
Hello
This is Elaine.
I am using package lattice to generate boxplots.
Using Richard's code, the display was almost perfect except the outlier
shape.
Based on the following code, the outliers are vertical lines.
However, I want the outliers to be empty circles.
Please kindly help how to modify the code to change the outlier shapes.
Thank you.
code
package (lattice)
dataN <-
2008 Nov 28
7
Examples of advanced data visualization
Dear R-help,
I am looking for ideas and presentations of new and advanced data visualization
methods. As an example of what I am searching for, the 'Many Eyes' pages at
http://manyeyes.alphaworks.ibm.com/manyeyes/
may provide a good paradigm. I would be interested even if it will not be easy
to implement such examples in R, e.g. because of the interactive nature of these
graphical
2008 Jul 08
4
Histogram with colors according to factor
Given a data frame with a continuous variable and a factor. I would like to
generate a histogram of the continuous variable, where each bar is filled
with different colors according to the percentage of factor values falling
into this region of the continuous variable.
I looked into packages like 'lattice' and 'ggplot2'. Searching R-help
revealed that 'histogram' is
2008 Feb 08
0
[PATCH] Make outputDeviceForGeometry behave smarter when dealing with overlapping outputs. Currently, the current output is returned if some part of the rectangle is on it; otherwise the output device the rectangle center is on is returned. This works
This makes scenarios like laptops with external monitors on Xrandr 1.2 work. Those e.g. have a 1280x800 output and a 1280x1024 output, completely overlapping each other. With this patch, outputDeviceForGeometry will return the smaller head for a rectangle that's completely inside the smaller head and the larger head otherwise.
---
src/screen.c | 88