This is web.xml file,and
index.jsp in under WEB-INF folder only.
&?xml version=&1.0& encoding=&UTF-8&?&
&web-app xmlns=&&
xmlns:xsi=&& version=&2.4&
xsi:schemaLocation=&
/web-app_2_4.xsd &&
&display-name&SME Project&/display-name&
&servlet-name&action&/servlet-name&
&servlet-class&
org.apache.struts.action.ActionServlet
&/servlet-class&
&init-param&
¶m-name&config&/param-name&
¶m-value&/WEB-INF/struts-config.xml&/param-value&
&/init-param&
&init-param&
¶m-name&debug&/param-name&
¶m-value&3&/param-value&
&/init-param&
&init-param&
¶m-name&detail&/param-name&
¶m-value&3&/param-value&
&/init-param&
&load-on-startup&1&/load-on-startup&
&/servlet&
&servlet-mapping&
&servlet-name&action&/servlet-name&
&url-pattern&*.do&/url-pattern&
&/servlet-mapping&
&jsp-config&
&taglib-uri&/tags/struts-tiles&/taglib-uri&
&taglib-location&/WEB-INF/struts-tiles.tld&/taglib-location&
&/jsp-config&
&welcome-file-list&
&welcome-file&/index.jsp&/welcome-file&
&/welcome-file-list&
&/web-app&
Popular White Paper On This Topic
14&Replies
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
&welcome-file-list&&br />
&welcome-file&/index.jsp&/welcome-file&&br />
&/welcome-file-list&&br />
should be&br />
&welcome-file-list&&br />
&welcome-file&/WEB-INF/index.jsp&/welcome-file&&br />
&/welcome-file-list&&br />
Ajuba" id="ctl00_m_m_i_ctl00_gr_ctl01_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3895372" />
replied Nov 24, 2010
&welcome-file-list&
&welcome-file&/index.jsp&/welcome-file&
&/welcome-file-list&
&welcome-file-list&
&welcome-file&/WEB-INF/index.jsp&/welcome-file&
&/welcome-file-list&
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
replied Nov 24, 2010
You have to put it outside of WEB-INF.
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
replied Nov 24, 2010
index.jsp file should be placed outside the WEB-INF folder
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
It is requirement/ decision of the application, not mandate of web application standards.&br />
HTH,&br />
Ajuba." id="ctl00_m_m_i_ctl00_gr_ctl07_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3895611" />
replied Nov 24, 2010
It is requirement/ decision of the application, not mandate of web application standards.
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
http://www.w3.org/2001/XMLSchema-instance&/a>& version=&2.4& & xsi:schemaLocation=&&a href=&/xml/ns/j2ee& rel=&nofollow& target=&_blank&>/xml/ns/j2ee&/a> & &a href=&/xml/ns/j2ee/web-app_2_4.xsd/web-app_2_4.xsd& rel=&nofollow& target=&_blank&>/xml/ns/j2ee/web-app_2_4.xsd/web-app_2_4.xsd&/a>/web-app_2_4.xsd/web-app_2_4.xsd && & SME Project & & action & & org.apache.struts.action.ActionServlet & & & config & /WEB-INF/struts-config.xml & & & debug & 3 & & & detail & 3 & & 1 & & & action & *.do & & & & /tags/struts-tiles & /WEB-INF/struts-tiles.tld & & & & /index.jsp" id="ctl00_m_m_i_ctl00_gr_ctl09_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3897118" />
replied Nov 24, 2010
Hi, You wrote like below:- /index.jsp So please try with this index.jsp Your every thing is ok just check with index.jsp instead of /index.jsp. On Wed, Nov 24, 2010 at 3:47 PM, GTstruts via java-l wrote: & Posted by GTstruts(Software Developer(Java)) & on Nov 24 at 5:18 AM Hi All, & This is web.xml file,and index.jsp in under WEB-INF folder only. & ========= & & xmlns:xsi=&& version=&2.4& & xsi:schemaLocation=& & /web-app_2_4.xsd/web-app_2_4.xsd && & SME Project & & action & & org.apache.struts.action.ActionServlet & & & config & /WEB-INF/struts-config.xml & & & debug & 3 & & & detail & 3 & & 1 & & & action & *.do & & & & /tags/struts-tiles & /WEB-INF/struts-tiles.tld & & & & /index.jsp
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
replied Nov 25, 2010
HTML, JSP files should in the root directory, not inside the WEB-INF folder.
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
replied Nov 25, 2010
Hi, Look at this syntax /index.jsp you mentioned that index.jsp is inside your project directory make sure to mention your path correct this will help you
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
replied Nov 25, 2010
There is no rule to keep jsp html out side of web-inf folder , now a days it is a good practice of having your jsps inside you WEB- INF folder to give extra protection, security to jsp contents.
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
Thanks --Mayank" id="ctl00_m_m_i_ctl00_gr_ctl17_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3898126" />
replied Nov 25, 2010
Put you jsp in the parallel of WEB-INF folder and ractify below entry in descripter, it will definitely work. index.jsp
Thanks --Mayank
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
be automatically created when you run the tomcat server. This is the&br />
default page that will be created when you start the Tomcat server..." id="ctl00_m_m_i_ctl00_gr_ctl19_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3898475" />
replied Nov 26, 2010
index.jsp page is must in every form to run JSP file. That page will
be automatically created when you run the tomcat server. This is the
default page that will be created when you start the Tomcat server...
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
I think your problem is solved.&br />
Could you put your reply.. weather your problem is solved or not..?&br />
Regards,&br />
Ajuba" id="ctl00_m_m_i_ctl00_gr_ctl21_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3898859" />
replied Nov 26, 2010
@ GTstruts
I think your problem is solved.
Could you put your reply.. weather your problem is solved or not..?
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
I think you have got your problem solved.&br />
Please put your reply.&br />
Regards,&br />
Ajuba" id="ctl00_m_m_i_ctl00_gr_ctl23_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3898955" />
replied Nov 26, 2010
@ GTstruts
I think you have got your problem solved.
Please put your reply.
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
Thanks for your response.&br />
index.jsp in WEB-INF folder and ...added
this syntax in web.xml&br />
&welcome-file-list&&br />
&welcome-file&index.jsp&/welcome-file&&br />
&/welcome-file-list&&br />
and now its working fine....." id="ctl00_m_m_i_ctl00_gr_ctl25_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3900465" />
replied Nov 28, 2010
Thanks for your response.
index.jsp in WEB-INF folder and ...added
this syntax in web.xml
&welcome-file-list&
&welcome-file&index.jsp&/welcome-file&
&/welcome-file-list&
and now its working fine.....
Best Answer
Mark this reply as the best answer?(Choose carefully, this can't be changed)
Usually html/jsp are meant for presentation logic that need not be secured&br />
where as business logic should certainly be secured. So its usual practice&br />
to place html/jsp outside WEB-INF and business logic files inside WEB-INF.&br />
THANKS-ASHA." id="ctl00_m_m_i_ctl00_gr_ctl27_bestanswerbody" class="textarea-bestanswerhidden" name="bestanswerbody" answerbodyId="3902893" />
replied Nov 30, 2010
Usually html/jsp are meant for presentation logic that need not be secured
where as business logic should certainly be secured. So its usual practice
to place html/jsp outside WEB-INF and business logic files inside WEB-INF.
THANKS-ASHA.
This thread has been closed due to inactivity.
PCMag Digital GroupPlease remember to follow the
at all times.In celebration of Nintendo's birthday, NIWA is holding a ! You can participate for a chance to win a $20 Nintendo eShop Gift Card! has been released for Android and iOS in most countries! Need help learning Pokémon GO? Take a look at our !Check
for up-to-date Pokémon news and discuss it on the
or in our IRC channel .
Be the first to know the Super Mario Run Release Date
From Bulbapedia, the community-driven Pokémon encyclopedia.
(Redirected from )
This article is incomplete.Please feel free to edit this article to add missing information and complete it. Reason: Info for the .
di three of her moves have been partially depleted in battle, while one move still retains all of its PP.
Power Points (Japanese: パワ?ポイント Power Points), or PP for short, are the energy that a
requires in order to perform a .
Power Points have existed in every . It costs 1 PP to use a move (barring the influence of the
), so the PP a move has remaining is essentially equivalent to the number of times that move can be used. Each move is assigned a base Power Point value that is either 1 or a positive multiple of 5, up to 40. In general, weaker moves learned at lower levels will have higher PP, while more powerful moves or moves learned at higher levels will have lower PP. PP can be fully restored by healing one's Pokémon at a , and effectively act as a method to encourage players to use them even if they take little or no .
When a move is learned, including through methods such as using
or , its PP will automatically be set to the base PP value, allowing it to be used immediately. However, in
only, when a move is replaced with a TM or HM move, the new move's remaining PP will be set to the remaining PP of the replaced move (unless the new move's base PP is lower). This was to prevent TMs and HMs from being a method to repeatedly replenish PP at no cost, as TMs were first made reusable in that generation. In , this behavior was reverted, and using a TM or HM to overwrite a move will set the newly learned move to its usual base PP though TMs and HMs are still reusable.
When the PP of a move has been depleted, the Pokémon will no longer be able to use that move until PP is restored. When all of a Pokémon's moves' PP have been depleted, ordering it to attack will result in the Pokémon using , a move that deals great damage to itself and minimal damage to the opponent.
All moves that target a Pokémon with
use two PP per use instead of one, causing them to deplete their PP faster. A move that has only 1 PP remaining will execute as normal in these situations. Moves that do not target the Pokémon with Pressure, such as
which target the user, deplete as normal. Pressure will also not activate if the Pokémon with Pressure targets itself.
A move that can be used outside of battle, such as
or one of the many
moves, will be able to be used outside of battle regardless of its PP on the field, and will not subtract PP for its overworld uses.
Upon using , all copied moves will have 5 PP (unless the maximum PP is less than 5, in which case the PP will be that lower maximum).
Some moves, especially the
and , have no PP value, giving them effectively infinite PP.
In , all AI opponents had unlimited PP.
All moves, except those which have a base PP of 1, can have their usability increased using a
or . PP Ups boost the move's PP by 20% of the original value per PP Up, and can be used up to three times on the same move. PP Maxes boost a move's PP by 60% of the original value and can only be used once, counting as 3 PP Ups. If a PP Max is used on a move that has already been boosted by a PP Up, it will boost the PP to whatever the maximum would be, serving as two PP Ups if one has already been used, and as one if two have been.
PP can be restored using , with the plain Ether restoring 10 PP for one move, Max Ether restoring full PP for one move, plain Elixir restoring 10 PP for all of a Pokémon's moves, and Max Elixir restoring full PP for all of a Pokémon's moves. The PP of all party Pokémon's moves will be fully restored when they are healed at a Pokémon Center, while the PP of individual Pokémon will be restored if they are deposited into the PC (Generation II onward).
PP can also be restored using , which restores 10 PP for one move, the Berry equivalent of Ether.
A Pokémon switched in after a Pokémon has used
will have its PP fully restored.
and , the maximum PP of a move that began at 40 PP would be 61, likely due to
this is fixed from
onward, increasing the maximum to its 'proper' value of 64.
Between Generations, the base PP of several moves, such as
and , was altered. If PP Ups had been used on one of these moves in a previous, this is carried over to later Generation, with the PP Ups now boosting based on the new value, rather than the old. For example, a Pokémon with Giga Drain with 2 PP Ups used on it in Generation III, having 7 PP for that move, would have 14 PP when transferred to Generation IV.
A notable glitch found in Generation I allowed
to be avoided by allowing the game to self-select a move to be used, which could happen to any move used immediately after a Pokémon was defrosted, or due to a handful of moves' effects (, , , , , , and ) because of the auto-selection involved with partial trapping moves. A move used with 0 PP in this way would
to the maximum possible value, 63 PP, and, due to the way the data is structured, a move that 0 PP Ups had been used on would gain full PP Up status, while those on which PP Ups had been used would lose one PP Up boost. This glitch was addressed in Generation II games and later, which prevent a move from being executed as well as selected if it has 0 PP.
after using the same move several times
tired of using
Unlike other stats, PP has not been directly referenced in the anime. However, many Pokémon have been seen to have trouble using a specific move repeatedly, such as 's increasing weakness using
as they chased him down.
Additionally, Pokémon get visibly exhausted over the course of a battle, even if they don't take any hits. In ,
even straight out said that there is a limit to how many times
would be able to use .
being incapable of using Thunder due to Pressure
While PP is almost never mentioned by name in , the effect of losing all PP of a move has been displayed a number of times:
was able to disable 's 's
by having his
acknowledged the fact that Thunder is a powerful move which takes a lot out of the Pokémon using it, thus limiting the amount of times it can be used within a certain period of time.
managed to prevent 's
from using
by having her
before it was defeated.
became unable to use Thunder while battling , due to Deoxys's
rendered 's 's
unusable during his
challenge by reducing its PP to zero with Grudge. Emerald later used an
on Shedinja to restore it.
As shown in several
sketches, Pokémon were originally planned to have a stat called TP, presumably short for , with each move requiring a certain amount of TP to use.
Points de Pouvoir (PP)
Angriffspunkte (AP)
Punti Potenza (PP)
????? Power Point (PP)
Puntos de Poder (PP)
This game mechanic article is part of , a
that aims to write comprehensive articles on the .
Navigation menu
This page was last modified on 21 August 2016, at 18:01.R plot data - visualize data and display charts & graphs using R
R has excellent graphics and plotting capabilities, which can mostly be found in 3 main sources: base graphics, the lattice package, the ggplot2 package.
The latter two are built on the highly flexible grid graphics package, while the base graphics routines adopt a pen and paper model for plotting, mostly written in Fortran, which date back to the early days of S, the precursor to R (for more on this, see the book
by John Chambers, which has lots of very useful information).
For a basic introduction, see the "getting started" page . Base graphics are very flexible and allow a great deal of customisation, with many individual functions available. However, they lack a coherent underlying framework and, for visualizing highly structured data, are outclassed by
Quick reference info:
demo("graphics") # Demonstration of graphics in R
# Help page for main plot function
# Help page for changing graphical parameters
# Help page on plot arrangement
example("pch")
# Point style examples
# List pre-defined named colours
# Help page on plotting maths symbols
demo(plotmath)
Useful plotting functions:
lines, points, abline, curve, text, rug, legend
segments, arrows, polygon
locator, identify
# For interacting with plots
Create some data for plotting:
x <- 10 + (1:20)/10
y <- x^2 + rnorm(length(x))
# Add Gaussian random number
plot(x, y)
curve(x^2, add=TRUE, lty=2)
# Add dashed line showing y=x^2
plot(x, y, type="l", col="blue")
# Plot as blue line (try 'type="o"')
plot(x, y, type="l", log="xy")
# Plot as line with log X & Y axes:
abline(v=11, lty=3)
# Add vertical dotted line
text(11.5, 120, "Hello")
# Add annotation
legend("topleft", inset=0.05, "data", pch=1, col="blue", bty="n")
# Add a legend
Different point styles:
plot(x, y, pch=2, col="red")
# Hollow triangles
plot(1:10, rep(1, 10), pch=LETTERS)
# Can also use any character
example("pch")
# Show point style examples
Plot symbols and colours can be specified as vectors, to allow individual specification for each point. R uses recycling of vectors in this situation to determine the attributes for each point, i.e. if the length of the vector is less than the number of points, the vector is repeated and concatenated to match the number required.
Single plot symbol (see "?points" for more) and colour (type "colours()" or "colors()" for the full list of predefined colours):
plot(x, y, pch=2, col="red")
# Hollow triangles
plot(x, y, pch=c(3, 20), col=c("red", "blue"))
# B red "+" signs
plot(x, y, pch=1:20)
# Different symbol for each point
Create vector of contiguous colours in a rainbow palette:
col <- rainbow(length(x))
plot(x, y, col=col)
Label axes:
plot(x, y, xlab="Some data", ylab="Wibble")
Axis limits are controlled by xlim and ylim, which are vectors of the minimum and maximum values, respectively.
Specify axis limits:
plot(x, y, xlim=c(11, 12), ylim=c(0, 150))
The basic idea behind the R function layout is to divide the plotting device into a series of rows and columns specified by a matrix. The matrix itself is composed of values referring to the plot number, generally just 1,2,3...etc., but can feature repetition.
Show simple 2x1 matrix:
matrix(1:2)
matrix(1:4)
matrix(1:4, 2, 2)
matrix(1:6, 3, 2)
# 3x2 ordered by columns
matrix(1:6, 3, 2, byrow=TRUE)
# 3x2 ordered by rows
To view the graphical layout, the following will show the borders of the sub-panels and the number identying each one:
layout(matrix(1:4, 2, 2))
layout.show(4)
# Specify layout for 4 panels, for the defined layout
layout.show(2)
# Try specifying just 2 instead
Now fill the layout with 4 plots:
plot(x, x)
plot(x, x^2)
plot(x, sqrt(x))
plot(x, log10(x))
curve(log10, add=TRUE)
# Adds to last panel plotted
The heights and widths arguments to layout are vectors of relative heights and widths of the matrix rows and columns, respectively.
Specifying panels of different sizes:
layout(matrix(1:4, 2, 2), heights=c(2, 1)); layout.show(4)
replicate(4, plot(x, x))
# Repeat plot 4 times
The function curve allows you to plot equations or complex functions, either on their own, or added to an existing plot (with add=T).
Plot some analytic expressions:
curve(x^2)
curve(x^1)
# "curve(x)" fails! (can also use "curve(I(x))")
curve(x^2+log10(x)-sin(x))
# Can use arithmetic
curve(dnorm)
# Normal distribution for mean=0, standard deviation=1
curve(x^3-x+1, from=-10, to=10, lty=2)
# Specify range & use dashed line
Plot a function, with specified arguments:
curve(dnorm(x, mean=1, sd=2), from=-10, to=10)
curve provides the function to be plotted with a vector of x-axis values called x with which to calculate the corresponding y-axis data. If the argument of your function is not called x (e.g. r) , then you need to use the following syntax: curve(myfun(r=x)). The following example illustrates this with a plot of several blackbody curves.
First, define a function for the Planck blackbody law to calculate the radiation intensity as a function of wavelength (lambda, in microns) and temperature (Temp, in Kelvin):
blackbody <- function(lambda, Temp=1e3) {
h <- 6. ; c <- 3e8; kb <- 1.
# constants
lambda <- lambda * 1e-6
# Convert from metres to microns
( 2*pi*h*c^2 ) / ( lambda^5*( exp( (h*c)/(lambda*kb*Temp) ) - 1 ) )
Now plot the curve for the default temperature of 1000K, with some axis labels:
main <- "Planck blackbody curves"
xlab <- expression(paste(Wavelength, " (", mu, "m)"))
ylab <- expression(paste(Intensity, " ", (W/m^3)))
col <- c("blue", "orange", "red")
lty <- 1:3
curve(blackbody(lambda=x), from=1, to=15, main=main, xlab=xlab, ylab=ylab,
col=col[1])
Finally, add 2 more curves for 900K and 800K:
curve(blackbody(lambda=x, T=900), add=T, col=col[2], lty=lty[2])
curve(blackbody(lambda=x, T=800), add=T, col=col[3], lty=lty[3])
legtext <- paste(c(, 800), "K", sep="")
legend("topright", inset=0.05, legend=legtext, lty=lty, col=col, text.col=col)
Print a copy to a PDF file (the resulting plot can be viewed ):
dev.copy2pdf(file="blackbody.pdf")
# Also "dev.copy2eps"
To find out the coordinates at a particular position on a graph, type:
then left click with the mouse any number of times within the axes an the R prompt will then return and a list will be printed with the X and Y coordinates of the positions clicked. You can retain this information by repeating the above, but with
A <- locator()
the coordinates will then be stored in A$x and A$y
To identify a particular point in a plot, use "identify", e.g:
x <- 1:10; y <- x^2
plot(x, y)
identify(x, y)
Now left click near one or more points and the element number of that point will be printed at the bottom, left, top or right of the point, depending on which side of it you clicked. Right click inside the axes to finish, and the element numbers of the points identified will be printed, as for locator
This is more useful if you have named points, in which case identify can print the name instead of the element number, for example:
names(x) <- LETTERS[1:length(x)]
plot(x, y)
identify(x, y, labels=names(x))
# don't forget right click to finish!
is an excellent package for visualizing multivariate data, which is essentially a port of the S software
to R. While it lacks the flexibility and extensibility of ggplot2, it nevertheless represents a great set of routines for quickly displaying complex data with ease. This makes it ideal for use in explo you can find out more by reading the excellent book
by Deepayan Sarkar.
Some examples of using lattice, first assemble some data (from ) on the masses (in kg) and semi-major axis lengths (in metres) of the Planets and a dotplot of the former:
planets.mass <- c("Mercury"=0.33, "Venus"=4.87, "Earth"=5.98, "Mars"=0.64,
"Jupiter"=1899, "Saturn"=569, "Uranus"=87, "Neptune"=102, "Pluto"=0.13) * 1e24
planets.semimajoraxis <- c("Mercury"=57.9, "Venus"=108, "Earth"=150,
"Mars"=228, "Jupiter"=778, "Saturn"=1430, "Uranus"=2870, "Neptune"=4500,
"Pluto"=5900) * 1e9
require(lattice)
# ensure package is loaded
dotplot(sort(log10(planets.mass)), xlab="log10 mass (kg)")
A histogram and a kernel-smoothed density plot of the semi-major axes:
histogram(log10(planets.semimajoraxis))
densityplot(log10(planets.semimajoraxis))
# shows raw data as "jittered" points
Now to demonstrate the multivariate capabilities, assemble the data in a data frame and create a categorical variable giant, which identifies the 4 most massive planets:
A <- data.frame(sma=planets.semimajoraxis, mass=planets.mass)
A$name <- rownames(A)
A$giant 1e25, "Giant", "Not giant")
Lattice can now separately handle the different categories, either by using group, to use different plotting symbols etc. within the same panel, e.g.:
dotplot(reorder(name, sma) ~ log10(sma), data=A,
xlab="log10 semi-major axis (m)", groups=giant, auto.key=TRUE)
...or by conditioning on a categorical variable, to plot separate panels for each dataset:
dotplot(reorder(name, sma) ~ log10(sma) | giant, data=A,
xlab="log10 semi-major axis (m)", auto.key=TRUE)
You can also easily plot linear regression models (from lm) for each group category, using the type argument:
xyplot(sma ~ mass, data=A, groups=giant, scales=list(log=TRUE),
type=c("g", "p", "r"), auto.key=list(lines=TRUE))
#---Other "type" arguments:
# "g" = show gridlines
# "p" = points
# "l" = lines (join the dots)
# "r" = linear regression model
# "smooth" = locally-weighted regression using "loess"
Lattice offers a very quick route to visualize a set of properties conditioned on one or more factors. For example, to show boxplots of 4 different quantities in separate panels, with each panel comparing values in different categories:
file <- "http://www.sr.bham.ac.uk/~ajrs/papers/sanderson09/sanderson09_table2.txt"
a <- read.table(file, header=TRUE, sep="|")
#--This plot is actually saved as an R object "p" (for use below) and with the
outer "(" & ")" the result is also printed (i.e. plotted in this case,
since "printing" a lattice object draws the plot):
( p <- bwplot( z + kT + Z + index ~ cctype, data=a, outer=TRUE,
scales="free", ylab="") )
Another excellent feature of lattice is the ability to span plots over multiple pages, using the layout argument (which is a vector specifying the required number of columns, rows & pages for the plot panels). This is great if you are plotting a large number of panels and want to dump them onto separate pages of a PDF document, say. Following on from the previous example (saved as the lattice object p):
devAskNewPage(TRUE)
# force prompt between each page
update(p, layout=c(2, 1, 2))
# 2 1 2 pages
devAskNewPage(FALSE)
# restore default
You can see examples of a
created with lattice, together with the R code that produced them in the .
The gg in ggplot2 refers to the book
(which I can highly recommend), by Leland Wilkinson, which has been implemented in an R package by Hadley Wickham. This is another excellent package for multivariate data analysis in R, which is based on a grammatical approach to graphics that provides great flexibility in design. Still under active delevelopment, the only noticeable (and slight) drawback with ggplot2 is the small delay in rendering the final plot. This reflects the fact that there's a lot going on behind the scenes in order to produce such highly polished graphics. The package has an offical
and you can find out more by reading the excellent book
by Hadley Wickham.
Continuing with the data frame of planet properties created :
# install.packages("ggplot2")
# package not one of the default R libraries
require(ggplot2)
# ensure package is loaded
ggplot(data=A, aes(x=mass, y=sma, label=name, colour=giant, shape=giant)) +
geom_point() +
scale_x_log10(limits=c(1e23, 1e28)) +
scale_y_log10() +
geom_text(adj=-0.2, legend=FALSE) +
labs(x="Planet mass (kg)", y="Semi-major axis of planet orbit (m)",
colour="Type", shape="Type")
You can see examples of plotting
and a multi-panel
created with ggplot2, together with the R code that produced them in the .
For more examples (with code snippets) of using ggplot2 to create a variety of plots, see the .
For further information, you can find out more about how to , , ,
Also, why not check out some of the graphs and plots shown in the , with the accompanying R source code used to create them.
Copyright &