-2

enter image description here

As you can see the spacing in between each of the items in X-axis is very squished. Is there a way to increase it?

Merged Data Frame (https://dl.dropbox.com/u/81597211/Untitled.pdf)

row.names   LCA_CASE_WORKLOC1_CITY  LCA_CASE_JOB_TITLE  LCA_CASE_WORKLOC1_STATE LCA_CASE_WAGE_RATE_FROM Company
    4726    REDWOOD SHORES  SOFTWARE DEVELOPER - ARCHITECT  CA  263500.00   ORACLE
    102663  DENVER  SOFTWARE ENGINEER (SOFTWARE DEVELOPER 5)    CO  170000.00   ORACLE
    103621  DENVER  SOFTWARE ENGINEER (SOFTWARE DEVELOPER 5)    CO  170000.00   ORACLE
    95210   SANTA CLARA SOFTWARE ENGINEER (SOFTWARE DEVELOPER 4)    CA  155000.00   ORACLE
    18858   SANTA CLARA SOFTWARE ENGINEER (CONSULTING SOLUTION DIRECTOR)    CA  150000.00   ORACLE
    19514   IRVING  CONSULTING TECHNICAL MANAGER    TX  150000.00   ORACLE
    57054   REDWOOD SHORES  SOFTWARE ENGINEER (SOFTWARE DEVELOPER 4)    CA  150000.00   ORACLE
    76335   REDWOOD SHORES  SOFTWARE ENGINEER (APPLICATIONS DEVELOPER 4)    CA  150000.00   ORACLE
    79964   REDWOOD SHORES  SOFTWARE ENGINEER (SOFTWARE DEVELOPER 5)    CA  150000.00   ORACLE

Code

colour = factor(merged$Company)
xcolor = factor(merged$LCA_CASE_WORKLOC1_STATE)
qplot(merged[[2]], merged[[4]], colour = colour, xlab="Positions", ylab ="Salary", main="H1B Salary 2012") + theme(axis.text.x=element_text(angle=90,vjust=0.5, hjust=1, size=10, color= xcolor, lineheight=10)) + scale_y_continuous(breaks=seq(0,300000, 10000)) + theme(panel.grid.minor = element_line(colour = "red", linetype = "dotted")) + scale_x_discrete(merged[[2]])
unj2
  • 52,135
  • 87
  • 247
  • 375
  • Please make your example reproducible, right now we have a hard time helping you. – Paul Hiemstra Mar 09 '13 at 21:50
  • I have attached the data and the sample code Paul – unj2 Mar 09 '13 at 22:04
  • By reproducible I mean that we have the data ourselves in R, see http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example or tips on how to do this. – Paul Hiemstra Mar 09 '13 at 22:10
  • How many posts will you make? http://stackoverflow.com/questions/15316267/add-a-second-legend-in-the-plot-in-r – Arun Mar 09 '13 at 22:38
  • The solution here is to plot fewer things. There's no way that a graph with that many items on the x axis will be informative or useful. – joran Mar 10 '13 at 02:28

1 Answers1

0

To increase readability of the labels you can switch the axis by adding + coord_flip() see here.

A second thing you can do is (after adding +coord_flip()) adjusting the heigth and width when exporting the plot and print it on A3 paper. Use for instance ggsave.

Jonas Tundo
  • 6,137
  • 2
  • 35
  • 45