multiple-axes

How to plot multiple graphs (faceting) using twoord.plot () in R?

让人想犯罪 __ 提交于 2019-12-11 01:48:21
问题 I have data that looks like this: height <- c(1,2,3,4,2,4,6,8) weight <- c(12,13,14,15,22,23,24,25) person <- c("Jack","Jim","Jill","Tess","Jack","Jim","Jill","Tess") set <- c(1,1,1,1,2,2,2,2) dat <- data.frame(set,person,height,weight) I'm trying to plot a graph with same x-axis(person), and 2 different y-axis (weight and height) using the twoord.plot function from the plotrix package. However, I do not know how to facet the plots like in ggplot2. For example, if my plots could overlay in

Adding two y-axis titles on the same axis

喜欢而已 提交于 2019-12-09 13:38:23
问题 I am going to use a dataset and plot that came from a previous problem (Here): dat <- read.table(text = " Division Year OperatingIncome 1 A 2012 11460 2 B 2012 7431 3 C 2012 -8121 4 D 2012 15719 5 E 2012 364 6 A 2011 12211 7 B 2011 6290 8 C 2011 -2657 9 D 2011 14657 10 E 2011 1257 11 A 2010 12895 12 B 2010 5381 13 C 2010 -2408 14 D 2010 11849 15 E 2010 517",header = TRUE,sep = "",row.names = 1) dat1 <- subset(dat,OperatingIncome >= 0) dat2 <- subset(dat,OperatingIncome < 0) ggplot() + geom

How do I plot points with two different y-axis ranges on the same panel in the same X axis?

假如想象 提交于 2019-12-06 12:30:39
I am trying to create a scatterplot using ggplot that shares an X axis but has a Y axis with two different scales. The bottom of the Y axis has three scales from 0% to 0.1%, then 0.1% to 1%, and then finally regular intervals by 10%. An example from here : Is there a way to produce something like this in R using ggplot? Would I be modifying the axes? Overlaying several plots on the same panel? Or something else? David Robinson Generally discontinuous axes are not recommended within ggplot2, for reasons explored in this question . Hadley Wickham (creator of ggplot2) explains here : I'm not a

Matplotlib: add twin y axis without using its values in the plots

帅比萌擦擦* 提交于 2019-12-06 04:08:00
This is to clarify the question title. Say you have four lists of integers, with which you want to produce a scatter plot: a=[3,7,2,8,12,17] b=[9,4,11,7,6,3] c=[9,3,17,13,10,5] d=[5,1,1,14,5,8] You also have a function, for simplicity f(x)=1/x , that applies to all lists, so that: from __future__ import division a1=[1/i for i in a] b1=[1/i for i in b] c1=[1/i for i in c] d1=[1/i for i in d] My question: how to add a second y axis, knowing that the values returned by the function range from 0.06 to 1.0 , without using any of the a1, b1, c1, d1 lists in the scatter plots? What I am saying is: if

Plotly: Grouped Bar Chart with multiple axes

不问归期 提交于 2019-12-05 02:54:33
When I set barmode='group' in Layout while trace2 = Bar(...,yaxis='y2') , this leads bars to be stacked or overlayed instead of grouping them. How can I group the bars while having multiple axes? I went over these but no avail: With single Y axis grouped bar chart is shown here . Multiple axes is also explained here and reference for y-axis is available here Here's an example of a grouped bar charts with multiple axes: https://plot.ly/~etpinard/2080/grouped-bars-on-multiple-axes/ The corresponding python code can be found here: https://plot.ly/~etpinard/2080/grouped-bars-on-multiple-axes.py

Gnuplot: Plot x2 axis with respect to x1 axis

随声附和 提交于 2019-12-04 11:38:22
问题 I seem to be having some difficulty finding the answer to this question online. The title is the basic question, but to be more specific I would like to have two x axes, one at the top of the figure that is dependent on the one at the bottom. However, this is not a simple relationship, i.e. x2!=5*x1 or something like that. The relationship is given by the data file itself. So to be more specific I have a file that looks something like this: V T P 2.0 15.0 0.586 3.0 17.4 0.798 4.0 25.3 1.023 5

Adding two y-axis titles on the same axis

人盡茶涼 提交于 2019-12-03 21:35:14
I am going to use a dataset and plot that came from a previous problem ( Here ): dat <- read.table(text = " Division Year OperatingIncome 1 A 2012 11460 2 B 2012 7431 3 C 2012 -8121 4 D 2012 15719 5 E 2012 364 6 A 2011 12211 7 B 2011 6290 8 C 2011 -2657 9 D 2011 14657 10 E 2011 1257 11 A 2010 12895 12 B 2010 5381 13 C 2010 -2408 14 D 2010 11849 15 E 2010 517",header = TRUE,sep = "",row.names = 1) dat1 <- subset(dat,OperatingIncome >= 0) dat2 <- subset(dat,OperatingIncome < 0) ggplot() + geom_bar(data = dat1, aes(x=Year, y=OperatingIncome, fill=Division),stat = "identity") + geom_bar(data =

Gnuplot: Plot x2 axis with respect to x1 axis

不羁的心 提交于 2019-12-03 07:30:42
I seem to be having some difficulty finding the answer to this question online. The title is the basic question, but to be more specific I would like to have two x axes, one at the top of the figure that is dependent on the one at the bottom. However, this is not a simple relationship, i.e. x2!=5*x1 or something like that. The relationship is given by the data file itself. So to be more specific I have a file that looks something like this: V T P 2.0 15.0 0.586 3.0 17.4 0.798 4.0 25.3 1.023 5.0 28.9 1.124 6.0 30.2 1.456 I would like to make a plot of T with respect to (wrt) P on the x1y1 axes