Questions tagged [annotate]

Use this tag for questions related to annotating plots, e.g. adding descriptive labels or annotations to data points.

490 questions
0
votes
1 answer

sas annotate for placing datalabels

I'm using sas sgplot to plot on variable with 3 responses. I want it to plot data from 3 columns. 1st column is total counts for an entity, 2nd column is violation counts for the same entity, and the 3rd column is percent violations. I'm using proc…
user601828
  • 499
  • 3
  • 7
  • 17
0
votes
1 answer

Word wrap in ggmap labels?

I have some very long labels for points on a map (Avg 35 chars per label). Is there a "word wrap" of sorts in ggmap annotate (or other labeling function) so the lines are not stretched across the map? I'd like to either limit by number of chars or…
Gondi
  • 67
  • 7
0
votes
2 answers

Annotate labels in pandas scatter plot

I saw this method from an older post but can't get the plot I want. To start import matplotlib.pyplot as plt import pandas as pd import numpy as np import string df = pd.DataFrame({'x':np.random.rand(10),'y':np.random.rand(10)}, …
STORMHOLD
  • 33
  • 1
  • 5
0
votes
1 answer

Django max based on foreign key queryset

I would like to annotate a queryset based on a foreign key, i.e. class A(models.Model): name = models.CharField(max_length=200) class B(models.Model): value = models.IntegerField() a = models.ForeignKey(A) I would like to annotate the…
C.B.
  • 8,096
  • 5
  • 20
  • 34
0
votes
1 answer

Inserting custom text in annotate() - R not working

It has been already asked but I couldn't find the exact answer for this. I am wondering if the following is doable. I have a bunch of scatter plot data in ggplot2 library and each has different mean and standard deviation, and the number of…
kukushkin
  • 312
  • 4
  • 16
0
votes
1 answer

Using .annotate() and extra() together in django

It seems i cannot use annotate and extra together when making a queryset This discussions = game.gamediscussion_set.filter(reply_to=None).annotate(up_votes = Count('userUpVotes'),…
dotty
  • 40,405
  • 66
  • 150
  • 195
0
votes
1 answer

intellisense.annotate a function with a dynamically created annotation

I have a function $.publish to publish a list of functions by binding the first argument to this, and I'm intending to use it for writing X.prototype, for example: X.prototype = (function () { function privateFunction(me) { ///…
Paul Chen
  • 1,873
  • 1
  • 16
  • 28
0
votes
1 answer

Django substract two fields from related model

With this models: class Vine(models.Model): autor = models.ForeignKey(Viner,related_name='autor') titulo = models.CharField(max_length=450) estado = models.CharField(choices=ESTADOS_VINE, max_length=30) objects = models.Manager() …
Miki Torandell
  • 163
  • 1
  • 11
0
votes
1 answer

Django templates are not showing values of annotations

I would like to display price SUM of all products related to particular room. Model: class Item(models.Model): product = models.CharField(max_length=150) quantity = models.DecimalField(max_digits=8, decimal_places=3) price =…
Marek H.
  • 59
  • 1
  • 10
0
votes
1 answer

Django: problem with merging querysets after annotation

I have a manager for "Dialog" looking like this: class AnnotationManager(models.Manager): def get_query_set(self): return super(AnnotationManager, self).get_query_set().annotate( num_votes=Count('vote', distinct=True), …
Björn Lilja
  • 393
  • 1
  • 4
  • 14
0
votes
1 answer

Why is Digest::SHA1 preventing proper annotation of a model?

I am using annotate in my app and all models are successfully annotated except for user.rb, which shows the following error when I annotate: Unable to annotate user.rb: wrong number of arguments (0 for 1) Outside of annotating, everything else…
topher
  • 301
  • 1
  • 5
  • 14
0
votes
1 answer

Django order_by after distinct(). Or distinct?

I need something like user_messages = UserMessage.objects.filter(Q(from_user=user) | Q(to_user=user)).order_by('dialog_id').distinct('dialog_id').order_by('created') Of course, it doesn't work. I found that I should use annotate(), but it seems to…
Alex O
  • 357
  • 3
  • 14
0
votes
0 answers

Get the more repeated register in the database Django

I have to do statistics on the patient with medical visits, I'm trying to use annotate, but I doesn't work, the way I want it. I need to get the member id(A7069001-03) with the more medical visits. consultassub =…
GioBot
  • 613
  • 5
  • 10
  • 17
0
votes
2 answers

comment or highlight two-column pdf using pdf-clown

I have searched for possible solution by googling/so/forums for pdfClown/pdfbox and posting the problem at SO. Problem: I have been trying to find a solution to highlight text, which spans across multiple lines in pdf document. The pdf can have…
user1830284
  • 101
  • 6
0
votes
1 answer

Django ORM annotate products with customer score

Consider the following Django model Customer(models.Model) name = models.CharField() Product(models.Model) name = models.CharField() Score(models.Model) points = models.IntegerField() customer = models.ForeignKey(Customer) …
Steve K
  • 83
  • 6