Haozhun
Haozhun

Reputation: 6511

Plot Cumulative Distribution Function (logarithmic x-axis / y-axis) in MatLab

I was using cdfplot, but it doesn't work as I need.
How can I get the x-axis become logarithmic? and how can I do it for y-axis?

Upvotes: 2

Views: 4664

Answers (1)

Egon
Egon

Reputation: 4787

You can do that by looking into handle graphics. Just run this code after you run cdfplot:

set(gca,'XScale','log')

What it does: it gets the axis handle (gca/get current axis) and sets it's XScale property. To know what properties are available, you can either consult the help or run inspect(gca).

You can also do the same thing manually on a single plot, to do this, you just plot everything and in the Figure window use the Tools > Edit Plot option. Then double click on the axis and you can set most properties right there.

Upvotes: 3

Related Questions