I am trying to find my feet in Julia and Plotting.
When I plot df (see below) the xticks shows values like
2005.0 2007.5 2010.0 2012.5 2015.0
while the range is of the type Int16.
I could, after several hours of reading, not find a way how to change that to
2005 2007 2009 2011 2013 2015
By the way is there a better way to convert :pubyear to an array of integers than I have done?
function pyint(x::Array{Any,1})
# convert array to Int16
y = Int16[]
for i in x
push!(y, convert(Int16, i))
end
y
end
function plot_world_share(df)
x = pyint(df[:pubyear])
@df df plot(x, [:Biological_Sciences :Chemistry :Geological_Sciences :Computer_Science :Mathematics :Physics :Statistics ])
end
df = get_world_share() #Not shown here
df[:pubyear]
11-element Array{Any,1}: # [2005:2015]
Regards
Johann