白边缘ggplot

时间:2017-12-26 08:09:34

标签: r ggplot2 jupyter-notebook

使用 jupyter notebook (在RStudio中不会发生),使用ggplot绘制图形并减少绘图的比例时:

EndpointCriticalAlarm:
 Type: "AWS::CloudWatch::Alarm"
 Properties:
  AlarmDescription: sample description
  AlarmName: HealthCheckAlarm
  Namespace: "AWS/Route53"
  MetricName: HealthCheckStatus
  ComparisonOperator: GreaterThanOrEqualToThreshold
  Period: 60
  EvaluationPeriods: 1
  Statistic: Average
  Threshold: !Ref FailureThreshold
  AlarmActions:
    - !Ref AlarmSNSTopicArn

ggplot(data)+
     theme(aspect.ratio=.5)

白色边距出现在图表的顶部和底部:

参见附件中的完整代码示例:

ggplot(data)+
     coord_fixed(ratio = 0.20)

Jupyter Notebook output picture

图:

enter image description here

我该如何解决这个问题?

感谢。

0 个答案:

没有答案