leeper/slopegraph

Matching label and line colours and consistent decimals

TonyLadson opened this issue · 3 comments

Thanks for all your work on this so far.

A couple of things.

  1. Could the label colours match the line colours?
  2. The number of decimal places is not consistent between columns.

The code I'm using is below and the resulting slopegraph is at this link. This shows the issues.

https://dl.dropboxusercontent.com/u/10963448/slope_graph.jpeg

library("RColorBrewer")
capex <- matrix(c(
  700348, 550203, 504668, 262529, 351732, # Perth
  1355928, 942090, 735799, 609752, 686136, # Melbourne
  805693, 792228, 713762, 629305, 641685, # Sydney
  504764, 989579, 653563, 517648, 487636, # South East Queensland
  256668, 230838, 143365, 59393, 48937, # Canberra
  595851, 530075, 331038, 187945, 152124, # Adelaide
  51978, 58080, 64789, 25600, NA), # Darwin
  nrow = 7, byrow = TRUE)


capex <-  capex/1000
capex <-  data.frame(capex)
cities <- c('Perth', 'Melbourne', 'Sydney','SE Queensland', 'Canberra', 'Adelaide', 'Darwin')
row.names(capex) <- cities
names(capex) <- c('X2010-11', 'X2011-12', 'X2012-13', 'X2013-14', 'X2014-15')

my_col = brewer.pal(9, name = 'Paired')
par(oma = c(1,4,1,1))

slopegraph(capex, 
           labels =  c('2010-11', '2011-12', '2012-13', '2013-14', '2014-15'),
           decimals = 0,
           col.lines = my_col,
           col.lab = my_col,
           family = 'sans')

Thanks. I'll take a look.

Thanks for this. I think I've fixed both issues. Here's the new output for your example code:

bugreport

Thank you