如何删除FileSystemRights : FullControl
AccessControlType : Allow
IdentityReference : Everyone
IsInherited : False
InheritanceFlags : None
PropagationFlags : None
周围的行。使用def get_attachment_path(instance, filename):
ext = os.path.splitext(filename)[1]
d = os.path.dirname(filename)
current_time = datetime.now().strftime('%Y%m%d-%H%M%S-%f')[:-3]
filename = os.path.join(d, current_time + ext)
return 'fW_media/bin/{}'.format(filename)
class FWVersion(models.Model):
bin_file = models.FileField(upload_to=get_attachment_path)
name = models.CharField(max_length=64)
create_time = models.DateTimeField(auto_now_add=True)
class GetFWView(viewsets.ModelViewSet):
queryset = FWVersion.objects.all()
serializer_class = GetFWSerializer
def create(self, request, *args, **kwargs):
serializer = UploadFWSerializer(data=request.data)
if serializer.is_valid():
instance = serializer.create(serializer.validated_data)
return Response('upload success')
else:
return Response(serializer.errors)
@list_route(methods=['GET'])
def get_latest(self, request):
lastest_fw = FWVersion.objects.latest('create_time')
serializer = self.get_serializer(lastest_fw)
return Response(serializer.data)
似乎没有明显效果。我可以设置`color
geom_label_repel
在空白label.size = 0
偶尔有效后输入library(ggplot2)
library(ggrepel)
ggplot(mtcars, aes(wt, mpg, color = wt)) +
geom_point(color = 'red') +
geom_label_repel(aes(label = rownames(mtcars)), label.size = 0, fill = "white") +
theme_classic(base_size = 16)
,但不可靠:这些框可能会显示在与文字不同的位置。
答案 0 :(得分:5)
正如评论中提到的eipi10,设置label.size=NA
:
library(ggplot2)
library(ggrepel)
ggplot(mtcars, aes(wt, mpg, color = wt)) +
geom_point(color = 'red') +
geom_label_repel(aes(label = rownames(mtcars)), label.size = NA, fill = "white") +
theme_classic(base_size = 16)
答案 1 :(得分:4)
您可以使用geom_text_repel
geom。
library(ggplot2)
library(ggrepel)
g <- ggplot(mtcars, aes(wt, mpg, color = wt)) +
geom_point(color = 'red') +
theme_classic(base_size = 16)
g + geom_label_repel(aes(label = rownames(mtcars)), fill = "white")
g + geom_text_repel(aes(label = rownames(mtcars)))
另外,根据帮助页面:
目前
geom_label_repel
...比geom_text_repel
慢得多。