axis-labels

change y axis labels in nvd3 scatter-chart

ぃ、小莉子 提交于 2019-12-02 02:20:22
I am trying to have my own y axis labels for the bubble chart in nvd3. Currently the labels are [1,2,3,4,5]. I want them to be displayed as [2,4,8,16,32]. I found the following function, chart.yAxis.tickValues(['2','4','8','16','32']); But the labels are not being changed here . I am unable to understand why. These tick values will not have any effect if the y values themselves are not within the 2-32 range. Right now that chart only has y values up to 2+. So, if in addition to adding chart.yAxis.tickValues(['2','4','8','16','32']); to the Chart Code/Javascript tab as you have in your question

Axis Labels in R: p(Y=y | theta = something)

杀马特。学长 韩版系。学妹 提交于 2019-12-02 00:45:32
问题 I've searched all over and can't find the code for having a conditional sign as in p(a|b) The code (generic R code, not ggplot) I'm using is ylab = bquote(Pr( Y == y | theta == .(mytheta) , n == .(n))) What this gives me for a label is Pr(|(Y=y,theta=0.2), n=10) Where the theta is a proper Greek symbol, mytheta is 0.2, and n is 10. So all that's not working is the conditional sign. It looks to me like R is taking the | for an or... I haven't tried ggplot yet, but would like to get this

Axis Labels in R: p(Y=y | theta = something)

醉酒当歌 提交于 2019-12-01 20:43:47
I've searched all over and can't find the code for having a conditional sign as in p(a|b) The code (generic R code, not ggplot) I'm using is ylab = bquote(Pr( Y == y | theta == .(mytheta) , n == .(n))) What this gives me for a label is Pr(|(Y=y,theta=0.2), n=10) Where the theta is a proper Greek symbol, mytheta is 0.2, and n is 10. So all that's not working is the conditional sign. It looks to me like R is taking the | for an or... I haven't tried ggplot yet, but would like to get this working in plain R first. Thanks for your help. I thought it was pretty interesting to see that 'pipe' (vs.

Plotly in R: format axis - tick labels to percentage

感情迁移 提交于 2019-12-01 16:30:19
I am creating bar charts in plotly with y-axis representing percentages or shares within 0-1. The y-axis displays as 0.05 instead of 5.0%. Is there a way to display y-axis tick labels as %## ? I have tried using tickformat = "%" but that doesn't seem to be working. You can do this in plotly using layout : p <- p %>% layout(yaxis = list(tickformat = "%")) Or if you want to only add % and do not reformat the numbers then: p <- p %>% layout(yaxis = list(ticksuffix = "%")) Example: This is an example that shows how to edit the y axis ticks as you wish. (like multiply by a number and add suffix,

Plotly in R: format axis - tick labels to percentage

最后都变了- 提交于 2019-12-01 14:19:55
问题 I am creating bar charts in plotly with y-axis representing percentages or shares within 0-1. The y-axis displays as 0.05 instead of 5.0%. Is there a way to display y-axis tick labels as %## ? I have tried using tickformat = "%" but that doesn't seem to be working. 回答1: You can do this in plotly using layout : p <- p %>% layout(yaxis = list(tickformat = "%")) Or if you want to only add % and do not reformat the numbers then: p <- p %>% layout(yaxis = list(ticksuffix = "%")) Example: This is

Multiple plots in R with different settings for each axis with less lines of code

。_饼干妹妹 提交于 2019-12-01 12:32:53
问题 In the graph below, Is it possible to create same graph with less lines of codes? I mean, since each Figs. A-D has different label settings, I have to write settings for each Fig. which makes it longer. The graph below is produced with the data in pdf device. Any help with these issues is highly appreciated.(Newbie to R!). Since all the code is too long to post here, I have posted a part relevant to the problem here for Fig.C #FigC label1=c(0,100,200,300) plot(data$TimeVariable2C,data

Multiple plots in R with both primary and secondary axes on all 4 sides with custom axis label

隐身守侯 提交于 2019-12-01 11:36:54
问题 According to the comments from others, this post has been separated into smaller questions from the previous version of this OP. In the graph below, will you help me to Close the side=4 (in each Figs. A-D), keeping the labels as it is (to the length as shown) and create minor ticks at secondary axes (side=3 and 4); no.of div=5. Why does minor.tick(nx=5,ny=5) produce 6 division in tick for Fig.C The graph below is produced with the data in pdf device. Any help with these issues is highly

R specifying x-axis ticks for a line plot

我的未来我决定 提交于 2019-12-01 10:59:04
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'm specifying. For example: If i have: y = c(227, 342, 121, 275, 354, 999, 221, 475, 867, 347, 541) x =

Several colors for the same tick/label

百般思念 提交于 2019-12-01 09:19:06
My data : dat <- data.frame(x = c(1,2,3,4,5,6), y = c(2,3,4,6,2,3)) Breaks and labels of my plot : breaks <- c(3,5) labels <- c(paste(3,"(0.3)"), paste(5,"(0.5)")) And my plot : library(ggplot2) ggplot() + geom_point(data = dat, aes(x = x, y = y)) + scale_y_continuous(breaks = breaks, labels = labels) I wish to colour the same labels differently. For instance, I wish to colour the "3" with a different colour than the one of "(0.3)". Here's a way to stick 2 plots together with patchwork , which is a package similar to cowplot but with a little more flexibility. I split the labels into 2 vectors

Gnuplot image on axis

不问归期 提交于 2019-12-01 08:35:31
I'm trying to model a certain progress through some environment. The x axis would represent the location (based on x coordinate) in the environment. In order to make this clear, I'd like an image of the environment (based on a .png) on the x axis (the environment is rather wide and not that high, so it should look good) of my plot, basically as an xtics/x-axis label. Do you have any suggestions on how to approach this? Thanks in advance! You can either plot both the image and the data in one plot command, or with multiplot . The first variant is easier, but the image is inside the plot, the