[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to scale the plot
From: |
Ben Abbott |
Subject: |
Re: How to scale the plot |
Date: |
Sat, 27 Apr 2013 07:29:36 +0800 |
On Apr 27, 2013, at 12:37 AM, z-999 wrote:
> Hi all,
>
> I am new to octave
>
> I want to plot the following :
>
> <http://octave.1599824.n4.nabble.com/file/n4652351/loglog.png>
>
>
> please help
>
> I tried using plot but the line not smooth
>
>
> plot (data (:,1), data (:,2)*0.000001);
I don't have your actual data values, but what you need to do is plot a line
and a set of points. The first plot is below.
T = [0.1 0.8 6.4 52.2];
N = [1, 2, 4, 8] * 1e3;
p = polyfit (log10(N), log10(T), 1);
n = linspace (1e3, 8e3, 701);
t = 10.^(polyval (p, log10(n)));
h = plot (n, t, N, T, "o");
set (h, "markerfacecolor", [0 0.5 0])
xlabel ("problem size N")
ylabel ("running time T(N)")
set (gca (), "xtick", [0:1e3:8e3],
"xticklabel", {"", "1K", "2K", "", "4K", "", "", "", "8K"},
"ytick", 0:5:50,
"yticklabel", {"", "", "10", "", "20", "", "30", "", "40", "",
"50"})
Ben