简体   繁体   English

如何在X轴保持不变的情况下将Y轴的间隔加倍

[英]How to double the intervals in Y-axis while X-axis remains same

I have a data set of a population I need the y-axis, to double with the following fixed interval: 我有一个人口数据集,我需要y轴,以以下固定间隔加倍:

 Y axis: 
 0, 
 250000
 500000
 1000000
 2000000
 4000000
 8000000
 16000000
 32000000

Then use the appropriate data. 然后使用适当的数据。

The data is currently in xls format. 数据当前为xls格式。 Please let me know if this is possible in Excel or R Language? 请让我知道使用Excel或R语言是否可行? or what is the solution to this. 或对此有什么解决方案。 Thanks 谢谢

I want the above values in the highlighted area in the below image 我想要上面图像中突出显示的区域中的上述值

在此处输入图片说明

Using R ggplot2: 使用R ggplot2:

library(ggplot2)

#dummy data
set.seed(123)
df <- data.frame(x = 1:10,
                 y = runif(10, 0, 3230000))

#plot
ggplot(df,aes(x,y)) +
  geom_line() +
  #add manual breaks for Y axis
  scale_y_continuous(
    breaks = c(0, 25000 * 2^c(0,1,2,3,4,5,6,7)))

在此处输入图片说明

i am not sure if this is what you want, if not please reformat your question 我不确定这是否是您想要的,否则请重新格式化您的问题

first cell value=0
second cell value=250000
other cell formula=previousCell*2
eg:

    cell a1=0
    cell a2=250000
    cell a3=a2+a2

    copy a3 and paste it to the rest of the cell

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 双 y 轴的 x 轴上的因子变量 - Factor variable on x-axis for double y-axis 相同的y轴,但不同的x轴图- - same y-axis but different x-axis graph - 如何将同步 R dygraphs 的 x 轴与单双 y 轴对齐? - How to align the x-axis of synchronized R dygraphs with single and double y-axis? 如何固定x轴和y轴比例 - how to fix x-axis and y-axis scale 生成多条线的折线图:X 轴无序且 y 轴刻度不等间隔 - Producing line graphs with multiple lines: X-axis is out of order and y-axis scales are not in even intervals 如何在保持x轴类别名称的同时,根据y轴值对图形的x轴类别进行排序? - How do I order the x-axis categories of a graph according to y-axis values while maintaining the x-axis category names? 如何在具有一个x轴和两个y轴的图中将误差线缩放到右y轴的尺寸 - How to scale the errorbars to the dimensions of the right y-axis in a plot with one x-axis and two y-axis 如何 plot x 轴上的一个表中的列和 y 轴上另一个表中的同名列 - How to plot a column from one table on x-axis and a column with same name from another table on y-axis 如何通过折线图将y轴上的所有点连接到同一组ggplot的x轴点 - How to connect all points on a y-axis to x-axis points of same group ggplot through a line graph ggplot:在x轴上绘制bin,在y轴上绘制平均值 - ggplot: Plotting the bins on x-axis and the average on y-axis
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM