Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glvisualize backend #374

Merged
merged 3 commits into from
Sep 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/axes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function Axis(sp::Subplot, letter::Symbol, args...; kw...)
lk = Symbol(letter, k)
lv = _axis_defaults_byletter[lk]
d[k] = (lv == :match ? v : lv)
end
end

# merge!(d, _axis_defaults)
d[:discrete_values] = []
Expand Down Expand Up @@ -309,15 +309,13 @@ function expand_extrema!(sp::Subplot, d::KW)

# expand for bar_width
if d[:seriestype] == :bar
dsym = vert ? :x : :y
dsym = (!vert) ? :x : :y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reverted this change... any idea why you did this? The idea is that it's setting a default bar width and expanding the axis extrema. When the plot is vertical, we want to update the x axis.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it was skewed in the wrong direction so I changed this and then it was working...

data = d[dsym]

bw = d[:bar_width]
if bw == nothing
bw = d[:bar_width] = mean(diff(data))
end
# @show data bw

axis = sp.attr[Symbol(dsym, :axis)]
expand_extrema!(axis, maximum(data) + 0.5maximum(bw))
expand_extrema!(axis, minimum(data) - 0.5minimum(bw))
Expand Down Expand Up @@ -489,4 +487,3 @@ function axis_drawing_info(sp::Subplot)

xticks, yticks, spine_segs, grid_segs
end

Loading