I want to plot the vector 4:10 but from 0 to 10. I don't like the large gap in produces, and I want to create my own style of plot, so I write the code:
plot(4:10,axes=FALSE,ylim=c(2,10),xlim=c(0,8))
axis(1,pos=2)
axis(2,pos=0,at=seq(2,10,2),labels=c('0','4','6','8','10'))
In order to not mislead the audience, I want to put in an axis break using axis.break() from plotrix. Unfortunately, when I add
axis.break(2,2.5)
on my plot, I don't get the break where my axis is but where it would be if I used the default axis. How do I get axisbreak() to move with my axis? Or else, how do I put an axis break where I want it?
Add pos=0 to your axis.break:
plot(4:10,axes=FALSE,ylim=c(2,10),xlim=c(0,8))
axis(1,pos=2)
axis(2,pos=0,at=seq(2,10,2),labels=c('0','4','6','8','10'))
axis.break(2,2.5,pos=0)
I have a complex layout of plots, say for example
layout(matrix(1:2,nrow=1), widths=c(1,7))
I have drawn earlier plots, and am now working on a particular plot (e.g. working on the code on the plot). I redraw the plot often to see impacts of changing e.g. margins.
How can I avoid that each time I redraw the plot it moves on to the next plot in the layout?
e.g. each time I have to start from the beginning, call dev.off, call layout, plot the earlier plots, and then start again with my plot.
Can I just select which plot in the layout I want to plot? Can I move the "counter" that selects which plot is being plotted next?
I am trying to create a new Area Line Graph that colors the space in-between the two lines, but for some reason I cannot accomplish this. The default behavior is to color the area from the series to the x-axis. Is there a way that you can only color in the space between the two series instead?
I am trying to mimic the behavior, but with HighCharts, here: https://confluence.atlassian.com/download/attachments/185729594/report_chart_created_vs_resolved_report.png?version=3&modificationDate=1354064895573&api=v2
I think you need to use the area range chart type: http://www.highcharts.com/demo/arearange
I want to display different colors in a line series based on some condition. As per my observation we can use fillFunction on columnseries to get different colored chart items, but it does not have any effect on lineseries. Is there any way by which we can get multi colored line series?
Can it help you?
flex line chart with variable colored line
The approach is a little bit strange but it works by me.
I have basic bar charts showing some value (1 value per chart) on each day. The charts are rendered using standard MS ASP.NET charts.
Now I would like to add a trend line. Has somebody done such thing and would be so kind to give me some hints how to approach this task? I know how to add a line to the chart, just would like to know whether someone already did such thing.
If I have understood the question correctly, you want to show a line graph using the same values that each bar is drawn.
You can do this by adding one more series with chart type as line to the same chart area.
Make the Y-axis for the series as secondary and keep X-axis as primary (to keep same X-axis values for both Bar & line graph). Or you can also make X-Axis of this new series as Secondary (this will show labels on top of chart area) .