axis-labels

R specifying x-axis ticks for a line plot

◇◆丶佛笑我妖孽 提交于 2019-12-01 07:42:39
问题 I have some time series with 200 values associated with 200 different times within an interval. After plotting the line plot, I would like to manually tell R to only show x axis ticks for some specific values I specify. Then, I would like to specify a different name, ie a date string, to be plotted at these ticks instead of the numerical value. I've looked at axis() but i'm having trouble putting this whole process together. I want the entire line graph to be plotted, not just the x labels i

d3 show labels only for ticks with data in a bar chart

故事扮演 提交于 2019-12-01 07:04:13
问题 First, I'm new with D3. :) I have a stacked bar chart. My y axis is a ordinal scale (state). In my data, I could have total=0 for some ticks. So, I just want to see the labels when the total > 0 but maintain all the ticks of the data. var data = [{ "state":"A", "total":"10"}, { "state":"B", "total":"0"}, { "state":"C", "total":"0"}, { "state":"D", "total":"20"}, { "state":"E", "total":"0"}, { "state":"F", "total":"50"}] I've tried this code, but this remove all the ticks with total = 0. I

How to adjust sizes of x-axis in dendrogram (R)?

那年仲夏 提交于 2019-12-01 06:59:51
I would like to adjust the x-axis in a dendrogram where all the labels are seen, for large data sets. As example, I use iris data here: > iris.data=subset(iris,select=-Species) > d <- dist(iris.data, method="euclidean") > hc <- hclust(d, "ward") > plot(hc, hang=-1, main="Dendrogram of Ward's Method", label=iris$Species) After the plot function is used, the dendrogram will be like this: So, how I'm going to adjust the x-axis so then all the species are all clear seen. Like @Roman Luštrik said : You can do like this : png("plotdendogram.png",width=1600,height=800) par(cex=1,font=3) plot(hc, hang

Set different positions of axis labels and tick marks in a barplot

一世执手 提交于 2019-12-01 05:56:39
I would like to realign/offset the x-axis and associated tick marks of a barplot. This should be simple but I am having trouble finding an answer. Below is some example data with 24 categories. xval = c(1:24) count = c(0.03,0.03,0.08,0.06,0.11,0.4,0.3,0.5,0.5,0.6,0.4,0.1,0.1,0.4,0.2,0.1,0.06,0.05,0.03,0.02,0.01,0.03,0.01,0.02) df = as.data.frame(cbind(xval, count)) I can easily produce a barplot with tick marks aligned at the bar midpoints using the below code: mp <- barplot(df$count, space=0, axes=FALSE) axis(side=2, pos=-0.2) axis(side=1, at =mp, labels=df$xval) I can also shift the entire x

Drawing minor ticks (not grid ticks) in ggplot2 in a date format axis

六月ゝ 毕业季﹏ 提交于 2019-12-01 05:49:42
I'm trying to get some graphics done for a publication in black and white, and I'm having some trouble with the axis. I need to plot the subticks for the data in the axis (not the grid), and I found a trick around it by using the annotation_logticks(base=2, sides="trbl") with base 2, since my data is not relevant in log. But that doesn't seem to work for the y axis, which is in date format type (xts). The graph I got so far is the one bellow, all I need is to remove the background grid (that part should be easy) and to add the ticks on the y axis (that's the difficult part for me). This is the

How to adjust sizes of x-axis in dendrogram (R)?

∥☆過路亽.° 提交于 2019-12-01 05:02:44
问题 I would like to adjust the x-axis in a dendrogram where all the labels are seen, for large data sets. As example, I use iris data here: > iris.data=subset(iris,select=-Species) > d <- dist(iris.data, method="euclidean") > hc <- hclust(d, "ward") > plot(hc, hang=-1, main="Dendrogram of Ward's Method", label=iris$Species) After the plot function is used, the dendrogram will be like this: So, how I'm going to adjust the x-axis so then all the species are all clear seen. 回答1: Like @Roman Luštrik

Chart: Show more value descriptions on X-Axis

こ雲淡風輕ζ 提交于 2019-12-01 03:03:56
I'm showing a Chart to the user which has one chart area with a line chart. On this, I got, for example, one line. This line has about 200 values. Those values do all have a description (e.g. "01.01.2013" , "05.02.2013" and so on). When the Chart is shown, I can only see two descriptions, even if there would be space for much more descriptions. The line gets displayed correctly, but there are only two points described. I rotated the Text vertically so there is more space, but this didn't help. If I display less values (5 or 10), the descriptions get shown correctly. This is how it actually

How to plot x-axis labels and bars between tick marks in ggplot2 bar plot?

独自空忆成欢 提交于 2019-12-01 00:58:06
问题 I prepared a MWE and hope for help on how to set ticks and labels at different position on the x-axis for a grouped bar plot. library(ggplot2) library(reshape2) data <- data.frame(name = c("X","Y","Z"), A = c(2,4,6), B = c(1,3,4), C = c(3,4,5)) data <- melt(data, id = 1) ggplot(data, aes(name,value)) + geom_bar(aes(fill = variable), position = "dodge", stat = "identity") The ticks should appear BETWEEN the groups, but the labels centered below the grouped bars (as they are in the figure). I

Chart: Show more value descriptions on X-Axis

旧城冷巷雨未停 提交于 2019-11-30 22:06:46
问题 I'm showing a Chart to the user which has one chart area with a line chart. On this, I got, for example, one line. This line has about 200 values. Those values do all have a description (e.g. "01.01.2013" , "05.02.2013" and so on). When the Chart is shown, I can only see two descriptions, even if there would be space for much more descriptions. The line gets displayed correctly, but there are only two points described. I rotated the Text vertically so there is more space, but this didn't help

r boxplot tilted labels x axis

谁都会走 提交于 2019-11-30 20:07:24
how can you rotate the labels of the x axis for boxplot in r? I know which code to use but I can't apply it: text(**????**, par("usr")[3] - 0.25, srt = 45, adj = 1, labels = labels, xpd = TRUE) What variable goes where I have the question marks? I created this boxplot: using this code: soil=read.csv("soil_temp_boxplot.csv", header=TRUE, sep=";") tiff("soil_boxplot.tiff") par(mar=c(5.5,3.5,0.5,0.5)) labels<-paste(c("RB-GL830-[16]-10","RB-GL830-[16]-30", "SB-GL834-[11]-10","SB-GL834-[11]-30", "RB-GL843-[17]-10","RB-GL843-[17]-30","SB-GL864-[12]-10","SB-GL864-[12]-30","SB-GL989-[10]-30", "RB-F844