1
$\begingroup$

I have a list of points that I am trying to plot. Is there a way to make a ListPlot where the y-axis increases normally by 1 every interval but the x-axis increases by $x^2$, i.e., 1, 4, 9, 16, etc.?

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. To get started, 1) take the introductory Tour now, 2) when you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge, 3) remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign, and 4) give help too, by answering questions in your areas of expertise. $\endgroup$ – bbgodfrey Jun 4 '15 at 19:27
  • $\begingroup$ closely related, unfortunately my answer doesn't seem to work in V10. $\endgroup$ – Kuba Jun 4 '15 at 20:49
  • $\begingroup$ of course the requested power law interval is not logarithmic. You ought to edit the question or title to clarify what you mean. $\endgroup$ – george2079 Jun 16 '15 at 19:47
3
$\begingroup$

This is precisely what ListLogLinearPlot achieves--logarithmic $x$ and linear $y$ axes:

ListLogLinearPlot[Table[{n, Sqrt[n]}, {n, 100}]]
$\endgroup$
1
$\begingroup$

You need to make custom ticks and transform the data:

 list = Table[ {x, Log[x]} , {x, 1, 25} ];
 ListPlot[{Sqrt[#[[1]]], #[[2]]} & /@ list , 
               Ticks -> {{#, #^2} & /@ Range[1, 5], Automatic} ]

enter image description here

$\endgroup$
1
$\begingroup$

To do this, you can define your own ticks marks when you do the plot.

   data = Table[{i, i}, {i, 1, 50, 1}]
   SpecialTicks = Table[{i^2, i}, {i, 1, 50, 1}];
   ListPlot[data, Frame -> True, FrameTicks -> {{Automatic, None}, {SpecialTicks, All}}]

enter image description here

Here, I've added "All" just to show the linear tick marks at the top of the graph, but you can remove them.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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