0
$\begingroup$

I want to divide y-axis by 300, so I used below code but it didn't work.

dpg3 = ListContourPlot[ddatas1r, ContourShading -> False, Contours -> {0}, ContourStyle -> Black, BaseStyle -> Thick,DataRange -> {xrange, yrange}]
$\endgroup$
8
  • $\begingroup$ You meant to say that divide each point on $y$-axis by 300? $\endgroup$
    – zhk
    Jan 18, 2017 at 13:15
  • $\begingroup$ Yes,exactly @MMM $\endgroup$
    – sara nj
    Jan 18, 2017 at 13:17
  • $\begingroup$ Have a look at Ticks. $\endgroup$
    – Sascha
    Jan 18, 2017 at 13:32
  • $\begingroup$ As @MMM said, I want to divide each point on y-axis by 300 $\endgroup$
    – sara nj
    Jan 18, 2017 at 13:57
  • $\begingroup$ It's easier to scale the y values by 300 than it is to scale the ticks I think, ListContourPlot[{#1, #2/300, #3} & @@@ ddatas1r, ContourShading -> False, Contours -> {0}, ContourStyle -> Black, BaseStyle -> Thick] $\endgroup$
    – Jason B.
    Jan 18, 2017 at 14:51

1 Answer 1

2
$\begingroup$
data = Table[Sin[i + j^2], {i, 0, 3, 0.1}, {j, 0, 3, 0.1}];
xrange = {1, Length[data[[1]]]}
yrange = {1, Length[data]}/300;
dpg1 = ListContourPlot[data, ContourShading -> False, 
  Contours -> {0},
  DataRange -> {xrange, yrange}]
$\endgroup$
2
  • $\begingroup$ I'm sorry but your code doesn't work in my case :( I added the code to the question $\endgroup$
    – sara nj
    Jan 18, 2017 at 14:40
  • 2
    $\begingroup$ @saranj - that's because you defined your data as a list of {x, y, z} values, so the data range is set by the list itself. I prefer Alan's method myself, keep the data as an array of z values, and supply the data range. in your case the data to plot would be ddatas1rArray = Table[ds1r, {e, 4000, 30000, 500}, {v, 0, 40, 3}] and the DataRange would be {{0, 39}, {4000, 30000}/300} $\endgroup$
    – Jason B.
    Jan 18, 2017 at 14:55

Not the answer you're looking for? Browse other questions tagged or ask your own question.