0

I have data set like below:

level   Year  Priority   Avg_Effort_in_Hrs    Total_Effort_in_Hrs
A      2015   Medium            33.6                34  
B      2016   Low               34.6                67  
C      2014   High              45.6                78
D      2016   High              67.6                89
E      2016   Low               56.8                346
F      2015   Medium            10                  76
G      2015   High              23.6                88 

I want to plot these data to see the avg_efforts_in_hrs and total_efforts_in_hrs by year,level and priority.

I am using below code to plot both these separately.

Problem here is that the discrete values in my level column are more than 200. When I plot these data its not clearly visible and also for some values its not assigning any shape.

###### Code ########

png(file="mygraphic_1.png",width=900,height=850)

ggplot(data=data, 
       aes(x=factor(Year), y=Avg_Effort_in_Hrs, 
           group=level,
           shape=level,
           color=Level)) + 
  #geom_line() + 
  geom_point(na.rm = TRUE,color="darkred", size=3) +
  scale_shape_manual(values=seq(0,48)) + ## because level 48 discrete values
  scale_x_discrete("Year") +
  scale_y_continuous("Avg_Effort_in_Hrs",breaks = seq(min(Avg_Effort_in_Hrs),max(Avg_Effort_in_Hrs),8)) + 
  facet_grid(.~Priority )

dev.off()

Below is for Total_efforts_in_hrs

png(file="mygraphic_1.png",width=900,height=850)

ggplot(data=data, 
       aes(x=factor(Year), y=Avg_Effort_in_Hrs, 
           group=level,
           shape=level,
           color=Level)) + 
  #geom_line() + 
  geom_point(na.rm = TRUE,color="darkred", size=3) +
  scale_shape_manual(values=seq(0,48)) + ## because level has 48 discrete values
  scale_x_discrete("Year") +
  scale_y_continuous("Avg_Effort_in_Hrs",breaks = seq(min(Avg_Effort_in_Hrs),max(Avg_Effort_in_Hrs),8)) + 
  facet_grid(.~Priority )

dev.off()

Could anyone please tell me how do I solve this issue and make my plot more visible and easy to interpret? Is any other better way to plot as per my requirement?

lmo
  • 37,904
  • 9
  • 56
  • 69
niranjan
  • 269
  • 3
  • 5
  • 13
  • 1
    You can't plot 48 categories as points and expect a reasonable interpretable plot. You'll have to come up with a better plan. Are there any subcategories you can assign? Perhaps you can use facets? – Axeman Feb 21 '17 at 09:40
  • ok. I don't have any subcategories. – niranjan Feb 21 '17 at 10:01

0 Answers0