当应该有两条线出现在我的情节上

时间:2018-11-21 01:55:51

标签: r ggplot2

我正在ggplot中绘制一个图,当我添加 services_api_instance=cm_client.ServicesResourceApi(api_client) services =services_api_instance.read_services(cluster.name, view='FULL') for service in services.items: print service.name, service.display_name, "-", service.type if service.type == 'YARN': yarn = service servicename = "yarn" 层时,它包含2行而不是1行。谁能帮助我了解它为什么这样做?

代码:

static void Main(string[] args)
        {
            Auth();
            var result = CreateTable().Result;
            Console.WriteLine(result);
            Console.ReadKey();
        }

async static Task<string> CreateTable()
{
      CloudTableClient tableClient = _storageAccount.CreateCloudTableClient();
      CloudTable peopleTable = tableClient.GetTableReference("XYZ");
      try
         {
                await peopleTable.CreateIfNotExistsAsync();
                People customer = new People("Garry", "Johnson");
                customer.Email = "xxx@yyy.zzz";
                customer.PhoneNumber = "123456789";
                TableOperation insertOperation = TableOperation.Insert(customer);
                var result = await peopleTable.ExecuteAsync(insertOperation);
                return result.HttpStatusCode.ToString();
        }
        catch (Exception ex)
        {
             Console.WriteLine(ex.Message);
        }
        return null;

  }

我只希望一条线按Cycle的顺序经过点,但是按Cycle排序根本不会改变这条线。我在做什么错了?

1 个答案:

答案 0 :(得分:3)

fill=DLT放在geom_point()部分中,而不是放在顶部。例如:

 ggplot(aes(x=Cycle, y=Dose), data = a) +
   scale_fill_manual(values = c("white", "darkred")) +
   geom_line(colour="grey20", size=1) +
   geom_point(shape=23, size=5, aes(fill=DLT)) +
   xlim(1, 4.5) +
   ylim(1, 4) +
   ylab("Dose Level") +
   theme_classic() +
   theme(axis.text   =element_text(size=10),
         axis.title  =element_text(size=12, face="bold", colour="grey20"),
         legend.text =element_text(size=10),
         legend.title=element_text(size=12, face="bold", colour="grey20"))