How to specify axis range without modifying dataset scale? - image-charts

I would like to know how to set the axis range and achieve the same behavior that Google Image Charts had. Here is the example for the same request URL:
I.e., I have an y value on each 100th of x axis. Is there a way to easily define a dataset 'step' for Image Charts, or I have to create custom labels on x axis with chxl, which I would like to avoid?

Image-Charts founder here :)
Indeed, regarding axis range our documentation is (I hope) explicit:
In Google Image Charts specifying the chxr parameter changed the scale of the axis but not the dataset scale. In Image-Charts — because we think it's was the biggest usage issue with Google Image Charts — changing the axis scale through chxr also impact the whole dataset scale.
You must make an axis visible using the chxt parameter if you want to specify its range.
You will have to use axis range (chxr) to better specify what you want and the steps needed:
chxr=
<axis_index>,<start_val>,<end_val>,<opt_step>
|...|
<axis_index>,<start_val>,<end_val>,<opt_step>

Related

How to expand your plot so all labels can be seen without overlapping in R

I have a plot with 50 categories(states) that show on my X axis, but in my output they are on top of each other. I want my plot to be spread out engough/large enough that there is no overlap and you could determine the state value from the next.
NOTE: i used the coord_flip command, so I know that my X-axis is actually my Y in image and vice versa. I am just wondering what function I would use to fix problem.
You can always change the size of the text via themes(axis.text.x=element_text(size=...))...
But the easy answer here is that your plot will change appearance based on the aspect ratio. When you view in Rstudio, you can adjust the size of your plot and you'll see the rearrangement. Additionally, when you save, the plot, play around in particular to the height and width to get the ratio you want. ggsave('filename.png', width=??, height=??).

Changing axis endpoints in iTorch plot

I'm trying to graph some data in an iTorch notebook. I can generate plots fine, but I want to change the endpoints of the axes. (My autogenerated y-axis is from 20-100, but I'd rather it be from 0-100 since it's a graph of percentages and I want the lower left corner to be the origin.)
I looked in the documentation, and in the list of methods implemented, and in the source code, but didn't find anything that lets me do this. I can zoom the generated graph, but it preserves aspect ratio, so I can't zoom just one of the axes.
Does anyone know how to do this? I'm half convinced this isn't implemented, but it seems like a very strange feature to leave out.
You can change the axis scale by mouse-scrolling over the axis ticks, and translate by drag-and-drop.
I know it's not ideal, but I had the same problem and that's the best I could find so far.

Google Charts Image. Data graph line is not according to axis

I am using Google Chart Image to make graphical chart. I am using PHP to provide the data to the link which in return gives me desired chart. The x-axis and y-axis values are also dynamic i.e. if the graph data is 23,45,37,29... then the y-axis value will range from 20 to 50 and if it is more then that then it will scale according to the data..
Now the problem I am not able to solve is that the dynamic values work fine but I am not able to move the graph line. The image below will clear this point:
Click here for the graph image.
The data provided to this graph is = 190.12,185.53,186.22,186.71,185.87,185.57,186.50,186.58,190.71,191.41,190.12185
The data range is approx between 180 to 190 but graph drawn is between 198 and 200.
I have used chxr to scale the axis. and the link which I am dynamically updating through php is:
THIS
I believe the problem you've got is that you're scaling the axis labels, but not the axis itself. You want to change the chds parameter from a to the range you're dealing with.
This chart looks okay to me.

Axis automatically changed?

I have a plot, where the lines are only in the negative range and when I plot it, the axis is automatically changed, i.e. negative larger values are going up and not down, in a normal plot. Currently I have the following plot:
But I want to have the y axis the other way round, so that negative larger values are going down and not up, I hope it is understandable what I mean.
How can I achieve this in R?
My code with my specific data is just using the normal plot() function.
As Ben Bolker said, the following has to be said:
I set the ylim range wrong, I set it like
ylim=c(-0.05,-1)
but
ylim=c(-1,-0.05)
should do what I want!

Increase the margin between y axis values of a Column chart

here is the image of column chart which i am drawing by using the samples provided in flash's help page.
Now i need to increase the margin of y axis series. For example, as per the attached image it is 200 and i want to make 500 so that less points should come on y axis label bar.
Thanks in adv!
You can create your own labelFunction through which you can change the default values of Y axis labels.
You can also use the Mahesh Parate's suggestion to set the min and max values of the Y axis label.
OR you can use both 1& 2 together
I dont think the above answers actually satisfies what was i looking for.
There is simple attribute in flash "interval". it does the trick.

Resources