1
votes

I am new to Julia and try to get a simple x-y plot through Gadfly Pkg. I am trying to plot x-axis in log scale and set min and max value in the same time.

plot(layer(rdsPmos, x="A", y="B", Geom.line), Scale.x_log10(minvalue= 10), Theme(default_point_size = 1.5px))

This won't get any error message. The outcome plot has a log scale x-axis but the minvalue seems not work.

I also try to write lise this:

plot(layer(rdsPmos, x="A", y="B", Geom.line), Scale.x_log10, Scale.x_continuous(minvalue= 10), Theme(default_point_size = 1.5px))

And the result is the minvalue work but the logscale fail.

1

1 Answers

2
votes

My tests shows that minvalue and maxvalue options works in the way that none of the data missed from view-port, (true for x_continuous or x_log10), so if one wants a narrower view-port, one way is to apply filter on data:

 julia> df = DataFrame(A = 1:10, B = 2:2:20)
10x2 DataFrames.DataFrame
| Row | A  | B  |
|-----|----|----|
| 1   | 1  | 2  |
| 2   | 2  | 4  |
| 3   | 3  | 6  |
| 4   | 4  | 8  |
| 5   | 5  | 10 |
| 6   | 6  | 12 |
| 7   | 7  | 14 |
| 8   | 8  | 16 |
| 9   | 9  | 18 |
| 10  | 10 | 20 |
  • minvalue is not working, and it's nothing with Scale type:

julia> plot(layer(df, x="A", y="B" ,Geom.line), Scale.x_log10(minvalue=5), Theme(default_point_size = 1.5px))

enter image description here

julia> plot(layer(df, x="A", y="B" ,Geom.line), Scale.x_continuous(
minvalue=5), Theme(default_point_size = 1.5px))

enter image description here

  • minvalue is working on filtered data

julia> plot(layer(df[df[:A].>5,:], x="A", y="B" ,Geom.line), Scale.x_log10(minvalue=5), Theme(default_point_size = 1.5px))

enter image description here