Asked by Bum
on 29 Dec 2012

I want to plot Extreme Value Type I,II,III distribution curve. How can I plot a graph that has two x-axis? One x-axis(main) which is 'reduced variate' is linear and the other x-axis(sub) which is 'year' is non-linear. It looks like as below.

one x-axis(main): reduced variate

-------------------------------------------

-2 -1 0 1 2 3 4 5 6

the other x-axis(sub): year

----------------------- 2 5 10 20 50 100

*No products are associated with this question.*

Answer by Walter Roberson
on 29 Dec 2012

In the File Exchange, you will find plotxx

Show 2 older comments

Bum
on 31 Dec 2012

Walter Roberson
on 31 Dec 2012

Which do you consider your "main" axis, and which do you consider your "sub" axis? "Which" in the sense of which one is to be the upper axis and which one is to be the lower axis?

When you speak of "transformed", is that a log() transformation? You have already said it was non-linear, but you did not indicate whether that meant "log" ?

If the user clicks on points using the data cursor, then which values should be shown to them, the "transformed" values or the "original" values?

The (x,y) that you have available to plot: are those the already-transformed values or are they the "original" values?

Bum
on 31 Dec 2012

Answer by Scott
on 31 Dec 2012

You have to be a little creative. I would start with the explanation at http://www.mathworks.com/help/matlab/creating_plots/using-multiple-x-and-y-axes.html. This isn't quite your case, but it explains how to do the overlays. You would plot the function twice on the two different axes. Then on the second one, you would need to use the 'XTick' and 'XTickLabel' properties to display the second axis as you described.

Answer by Malcolm Lidierth
on 31 Dec 2012

With Waterloo graphics, you can have any number of layered graphs each with independent axes (linear, log etc):

For MATLAB examples see:

http://undocumentedmatlab.com/blog/waterloo-graphics-examples/

For the project website see:

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments