0

Trying to build a plot with an exponent x-axis. It should start with 0 and increasing by the power of 1.85

i.e.:
tick:1 label:1000 value:3.55
tick:2 label:1500 value:7.51
tick:3 label:2000 value:12.79
tick:4 label:2500 value:19.33
tick:5 label:3000 value:27.08
and so on untill 7000.

obviously, the value should be the distance of the tick from the 0,0 point. The y-axis should be from 0 to 7.

Being trying to achieve this using custom ticks without success.
I'm guessing I could use a function to produce the array but don't know how.

toy4fun
  • 839
  • 2
  • 14
  • 33

1 Answers1

2

If flot doesn't allow your to have exponential axes, with custom exponents, then just pre scale your axes and data and use custom ticks and labels.

EDIT: here is a jsFiddle which i think does what you want. The tickLabel rotation is annoyingly necessary to prevent the labels overlapping one another.

will
  • 10,260
  • 6
  • 46
  • 69
  • Following your sample, I've manage to get the plot I wanted [here](http://jsfiddle.net/9gzSy/4/), thanks. Couldn't get the last label to show up nor setting the y-axis max. to 7... – toy4fun May 27 '12 at 15:32
  • @toy4fun - Just change the `<7000` in the loop to `<=7000`. For the yaxis you have a typo in your jsfiddle. `yaxes` should be `yaxis`. Also maybe mark this as the answer? – will May 27 '12 at 18:03