Plot a distorted x axis without changing shape

8 views (last 30 days)
Hello to everybody,
I'm trying to find a way to plot a distorted x axis without changing the shape of the plot.
For example.
plot(x,y); %straight line
I'd want to have the exact same shape of the graph (the line) but with the values of the x axes coming from the transformation:
So that plot (T,y) will give the exact same line of before, but x axis will be distorted.
Hope it's clear
Thank you.

Accepted Answer

Cris LaPierre
Cris LaPierre on 20 Mar 2021
Your xticks and xticklabels do not need to be the same value. You can set the xticklabels to be whatever you want.
Perhaps something like this?
plot(x,y); %straight line
% query the xtick values
xt = xticks;
% transform the xtick values
% update the xticklabels with the transformed values

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!