Trying to plot a graph (scatter plot with line ) using a variable (rip) which takes values differently by fyear, state and item. See a sample data below.
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(rip fyear) str16 state str9 item
         . 201011 "ANDHRA PRADESH" "bidi"     
 .09099022 201112 "ANDHRA PRADESH" "bidi"     
 .10854694 201213 "ANDHRA PRADESH" "bidi"     
 .10353264 201314 "ANDHRA PRADESH" "bidi"     
  .0962819 201415 "ANDHRA PRADESH" "bidi"     
 .08711275 201516 "ANDHRA PRADESH" "bidi"     
 .08109602 201617 "ANDHRA PRADESH" "bidi"     
 .08437795 201718 "ANDHRA PRADESH" "bidi"     
 .08440902 201819 "ANDHRA PRADESH" "bidi"     
         . 201011 "ANDHRA PRADESH" "chewing"  
    .52594 201112 "ANDHRA PRADESH" "chewing"  
   .573869 201213 "ANDHRA PRADESH" "chewing"  
  .4906687 201314 "ANDHRA PRADESH" "chewing"  
   .507094 201415 "ANDHRA PRADESH" "chewing"  
  .4349617 201516 "ANDHRA PRADESH" "chewing"  
   .379727 201617 "ANDHRA PRADESH" "chewing"  
  .3401141 201718 "ANDHRA PRADESH" "chewing"  
  .3209431 201819 "ANDHRA PRADESH" "chewing"  
         . 201011 "ANDHRA PRADESH" "cigarette"
  .6422687 201112 "ANDHRA PRADESH" "cigarette"
  .7280357 201213 "ANDHRA PRADESH" "cigarette"
  .7079984 201314 "ANDHRA PRADESH" "cigarette"
   .679833 201415 "ANDHRA PRADESH" "cigarette"
  .6249001 201516 "ANDHRA PRADESH" "cigarette"
  .6212281 201617 "ANDHRA PRADESH" "cigarette"
  .5683537 201718 "ANDHRA PRADESH" "cigarette"
  .5830745 201819 "ANDHRA PRADESH" "cigarette"
         . 201011 "ASSAM"          "bidi"     
 .07124937 201112 "ASSAM"          "bidi"     
.072014794 201213 "ASSAM"          "bidi"     
 .07024458 201314 "ASSAM"          "bidi"     
 .06895715 201415 "ASSAM"          "bidi"     
.063124955 201516 "ASSAM"          "bidi"     
 .06579541 201617 "ASSAM"          "bidi"     
 .07138462 201718 "ASSAM"          "bidi"     
 .06889646 201819 "ASSAM"          "bidi"     
         . 201011 "ASSAM"          "chewing"  
 .08735093 201112 "ASSAM"          "chewing"  
 .07451655 201213 "ASSAM"          "chewing"  
 .06969457 201314 "ASSAM"          "chewing"  
  .0770348 201415 "ASSAM"          "chewing"  
 .09772397 201516 "ASSAM"          "chewing"  
 .09071058 201617 "ASSAM"          "chewing"  
 .08697958 201718 "ASSAM"          "chewing"  
 .08091222 201819 "ASSAM"          "chewing"  
         . 201011 "ASSAM"          "cigarette"
  .5504718 201112 "ASSAM"          "cigarette"
  .5141999 201213 "ASSAM"          "cigarette"
 .57849634 201314 "ASSAM"          "cigarette"
 .57627475 201415 "ASSAM"          "cigarette"
 .53460586 201516 "ASSAM"          "cigarette"
  .5026038 201617 "ASSAM"          "cigarette"
    .48206 201718 "ASSAM"          "cigarette"
  .4520759 201819 "ASSAM"          "cigarette"
         . 201011 "BIHAR"          "bidi"     
  .0886173 201112 "BIHAR"          "bidi"     
  .0779648 201213 "BIHAR"          "bidi"     
 .08331867 201314 "BIHAR"          "bidi"     
  .0885797 201415 "BIHAR"          "bidi"     
 .10049088 201516 "BIHAR"          "bidi"     
 .08846604 201617 "BIHAR"          "bidi"     
 .07779509 201718 "BIHAR"          "bidi"     
 .07439497 201819 "BIHAR"          "bidi"     
         . 201011 "BIHAR"          "chewing"  
 .10634077 201112 "BIHAR"          "chewing"  
 .09940512 201213 "BIHAR"          "chewing"  
 .10277797 201314 "BIHAR"          "chewing"  
 .10430764 201415 "BIHAR"          "chewing"  
 .11484671 201516 "BIHAR"          "chewing"  
 .10868685 201617 "BIHAR"          "chewing"  
 .09779953 201718 "BIHAR"          "chewing"  
 .09777625 201819 "BIHAR"          "chewing"  
         . 201011 "BIHAR"          "cigarette"
 1.1298708 201112 "BIHAR"          "cigarette"
 1.1109984 201213 "BIHAR"          "cigarette"
 1.1648171 201314 "BIHAR"          "cigarette"
 1.3054184 201415 "BIHAR"          "cigarette"
  1.342271 201516 "BIHAR"          "cigarette"
 1.2638005 201617 "BIHAR"          "cigarette"
 1.1409205 201718 "BIHAR"          "cigarette"
  1.232831 201819 "BIHAR"          "cigarette"
         . 201011 "CHANDIGARH"     "bidi"     
 .02962901 201112 "CHANDIGARH"     "bidi"     
 .02758915 201213 "CHANDIGARH"     "bidi"     
 .02607511 201314 "CHANDIGARH"     "bidi"     
.023134753 201415 "CHANDIGARH"     "bidi"     
.022966146 201516 "CHANDIGARH"     "bidi"     
.025267234 201617 "CHANDIGARH"     "bidi"     
  .0391226 201718 "CHANDIGARH"     "bidi"     
 .04377725 201819 "CHANDIGARH"     "bidi"     
         . 201011 "CHANDIGARH"     "cigarette"
 .27653742 201112 "CHANDIGARH"     "cigarette"
  .3126252 201213 "CHANDIGARH"     "cigarette"
  .3424058 201314 "CHANDIGARH"     "cigarette"
  .3550999 201415 "CHANDIGARH"     "cigarette"
  .3633941 201516 "CHANDIGARH"     "cigarette"
  .3496068 201617 "CHANDIGARH"     "cigarette"
  .3621924 201718 "CHANDIGARH"     "cigarette"
  .3684403 201819 "CHANDIGARH"     "cigarette"
         . 201011 "CHHATISGARH"    "bidi"     
end
I want a code similar to
Code:
scatter rip fyear, by(state) connect(l)
Since I have 3 commodities under the categorical variable "item" and there is a single rip variable for all three commodities in "item", each small graph returns 3 observations each against each value of fyear. Is there any way, I could color code the points for each item with a separate color so that it looks three distinct lines on each graph. I also do not need any line connecting the dots between values of any two observations belonging to different categories in the variable "item".

Also, is there any way to fit rip values of one of these items on a secondary axis as it has values very different from the other two categories in "item". Scale differences makes the graph pretty bad and it will be good to show the rip values of that particular category on a different y axis.

Can someone help me with it?