The x value vector x=[5e-10, 5e-9, 5e-8, 5e-7, 5e-6]. If plot(,xticks=x)
then it’s marked after logged. Can I notate it by 5e** scale correspondingly? Also, is it possible to tick y=collect(0:10:100) by its original form on y axis not logged?
You can do something like this in Gaston, which uses gnuplot to plot:
using Gaston
t=1:0.01:10
set(axis="loglog")
plot(t,sin.(2π*t).+2,gpcom="set xtics 0, 2, 10 nologscale")
which produces
The key part is the nologscale
tics parameter. See page 190 in Gnuplot’s 5.2 user manual for more details.
It was successfully installed but fail to be used.
(v1.3) pkg> add Gaston
Updating registry at `C:\Users\Amend\.julia\registries\General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Installed Gaston ─ v0.10.0
Updating `C:\Users\Amend\.julia\environments\v1.3\Project.toml`
[4b11ee91] + Gaston v0.10.0
Updating `C:\Users\Amend\.julia\environments\v1.3\Manifest.toml`
[4b11ee91] + Gaston v0.10.0
julia> using Gaston
[ Info: Precompiling Gaston [4b11ee91-296f-5714-9832-002c20994614]
ERROR: InitError: Gaston cannot be loaded: gnuplot is not available on this system.
Stacktrace:
[1] __init__() at C:\Users\Amend\.julia\packages\Gaston\JtE39\src\Gaston.jl:64
[2] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:692
[3] _require_from_serialized(::String) at .\loading.jl:743
[4] _require(::Base.PkgId) at .\loading.jl:1034
[5] require(::Base.PkgId) at .\loading.jl:922
[6] require(::Module, ::Symbol) at .\loading.jl:917
during initialization of module Gaston
I searched for the error report but only found
https://maleadt.github.io/NewPkgEval.jl/detail/Gaston.html
Sorry I got confused. Is Gaston availale to Julia1.3.0 or this system
? Also, if this can be solved, can the same syntax be applied in scatter()?
Yeah – you need to install gnuplot too: gnuplot download
And yeah – the same syntax is available to scatter
.
The flexibility is awesome!
I installed Gaston from
Though a warning appears after installation
But in julia,
using Gaston
is successful. However, it keeps reportingconfig not defined
julia> using Gaston
julia> t=1:0.01:10
1.0:0.01:10.0
julia> Gaston.set(axis="loglog")
ERROR: UndefVarError: config not defined
Stacktrace:
[1] (::Gaston.var"#kw##set")(::NamedTuple{(:axis,),Tuple{String}}, ::typeof(set)) at .\none:0
[2] top-level scope at none:0
julia> Gaston.plot(t,sin.(2π*t).+2,gpcom="set xtics 0, 2, 10 nologscale")
ERROR: UndefVarError: config not defined
Stacktrace:
[1] (::Gaston.var"#kw##plot")(::NamedTuple{(:gpcom,),Tuple{String}}, ::typeof(Gaston.plot), ::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::Array{Float64,1}) at .\none:0
[2] top-level scope at none:0
Hmh, that’s a new one… Is this in a fresh Julia session? Are you running Gaston v0.10 (not master)?
BTW, you can run set(...)
and plot(...)
, without Gaston.
at the start.
thanks but that’s the reason I added Gaston.
before set
julia> using Gaston
julia> t=1:0.01:10
julia> set(axis="loglog")
ERROR: UndefVarError: config not defined
julia> plot(t,sin.(2π*t).+2,gpcom="set xtics 0, 2, 10 nologscale")
ERROR: Unknown key: gpcom
Yes it’s
julia> Pkg.API.installed()["Gaston"]
v"0.10.0"
The only reason I can think of for getting this message is that you’re running the same session where using Gaston
failed (because gnuplot was not installed), and something was left uninitialized. Can you try exiting Julia and starting again?