# Has anyone used log axes in GR?

**URL:** https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836
**Category:** General Usage
**Created:** [December 4, 2019, 7:13am UTC](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836 "2019-12-04T07:13:56Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)
#### Post date: [December 4, 2019, 7:13am UTC](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836/1 "2019-12-04T07:13:56Z")

</div>

I tried doing the following:

```julia
using GR

x = 1:100
y = abs.(randn(100))
setscale(GR.OPTION_X_LOG)
plot(x,y)
readline()

```

and no logarithmic x-axis. i thought i was crazy, so i looked for an example that used a log axis and i can’t find a single example that uses a log axis. So I may not be crazy, it might not work…  
I also did a simple plot in the REPL and used inqscale to see if it would readback the correct scale, and it does read back a 1, but the plot does not use a logarithmic x-scale.

---

<div class="post-metadata">

### Author: ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)
#### Post date: [December 4, 2019, 7:50am UTC](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836/2 "2019-12-04T07:50:38Z")

</div>

You should use:

```julia
plot(x,y,xlog=true)

```

You can’t mix low-level and high-level GR functions. I’m aware, that this should be better documented.

---

<div class="post-metadata">

### Author: ![purplishrock](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/purplishrock/32/13451_2.png) [@purplishrock](https://discourse.julialang.org/u/purplishrock)
#### Post date: [December 4, 2019, 5:31pm UTC](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836/3 "2019-12-04T17:31:04Z")

</div>

ok. I think my main problem is that i see

_function_ `plot` ( _args_ ::PlotArg…; _kv_ …)

however I can’t find any documentation for the kv, aka “kwargs” arguments, for example i can’t find anything that tells me xlog=true is available. Am I just not finding it or are they undocumented ? I get the impression this is following matlab conventions and maybe i should just look at the matlab plot options to figure it out.

Also I did figure out why repeated plots are slow-ish.

I ran an experiment using polyline and if I call 1000 polylines(), invoking updatews() between each one then things really slow down.

instead, if i simply draw the 1000 polylines, and THEN call updatews() when i’m done the graph appear immediately.

i expect that updatews() is doing a lot more work than i think it is and hence the reason it’s slower.

Thanks again for your help.

---

<div class="post-metadata">

### Author: ![jheinen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jheinen/32/2787_2.png) [@jheinen](https://discourse.julialang.org/u/jheinen)
#### Post date: [December 4, 2019, 8:16pm UTC](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836/4 "2019-12-04T20:16:36Z")

</div>

I am aware that some things are inadequately documented, which is why the performance of our software is sometimes underestimated. Also the convenience layer has to be revised urgently - hopefully we will find the time soon …

---

<div class="post-metadata">

### Author: ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)
#### Post date: [December 4, 2019, 10:53pm UTC](https://discourse.julialang.org/t/has-anyone-used-log-axes-in-gr/31836/5 "2019-12-04T22:53:26Z")

</div>

While the official “convenience layer” of GR and its documentation is updated, you may try looking at [GRUtils](https://heliosdrm.github.io/GRUtils.jl/). That is my personal proposal for a redesign of the high-level API of GR, including also more detailed documentation.

Although internals are different, the API of GRUitls mimicks the convenience layer of GR, so in many cases you might be able to make GR plots following the docs of GRUtils (e.g. for tricks like `xlog=true`, etc), Major departures are reported in [Introduction · GRUtils.jl](https://heliosdrm.github.io/GRUtils.jl/stable/#Relationship-with-GR's-API-1).

If you want you may also use that package on top of GR, in order to take advantage of some additional functions and keyword arguments.
