Use this tag for questions related to annotating plots, e.g. adding descriptive labels or annotations to data points.
Questions tagged [annotate]
490 questions
0
votes
0 answers
How to get the Total Sum for different fields of an object with annotate in Django?
I've got three models like this:
class Corredor (models.Model):
dorsal=models.IntegerField(primary_key=True)
tipo=models.CharField(max_length=50)
nombre=models.CharField(max_length=50)
f_nacimiento=models.DateField(default=1/1/1975)
…

Antonio
- 11
- 3
0
votes
1 answer
Django Annotate foreign key - user specific status to an object
There are Widget and UserStatus models.
Challenge: Get a QuerySet of widgets, annotated with unified status from user and widget.
Logic: If has user status, use that, else use the widget's…

Lucianovici
- 314
- 3
- 9
0
votes
0 answers
Why my annotation group by is not working as expected?
I wanna do a query like raw sql select count(b.status) from a left out join b on a.id = b.user_id group_by(b.status). I know how to get what I wanted using raw sql. But when I try to implement this using orm, it failed. Below is the…

Gorgine
- 310
- 2
- 11
0
votes
0 answers
R - Annotate a map with inset plots/graphs?
Using R, I'd like to display inset plots/graphs on a map that show profiles for specific places on the map and lines that points from the graph to the point on the map like in ggrepel but with plots instead of labels.
I was thinking of using…

Arthur Yip
- 5,810
- 2
- 31
- 50
0
votes
0 answers
ax.annotate does not appear
ax.annotate is not working for this particular column. However, it is working for all the other columns in the dataset. Unable to understand why. Any help would be appreciated.
plt.figure(figsize=(15, 8))
sns.countplot(x = 'How many employees does…
0
votes
1 answer
Add text (or annotation) above (or below) the legend of a ggplot barplot with facet
I've literally spend a couple of days searching for the correct answer to this. I want to place additional text/annotation on the outside of the plot area--above or below the legend--on a geom_bar that has nested facets like below.
Some things I've…

user3029412
- 99
- 8
0
votes
1 answer
Text labels outside ggplot piechart
how do I put a comment outside a ggplot piechart? Ideally in the corner of a window.
Any operations including cartesian coordinates somehow ruin the plot. I just need a simple comment about the source of data.
TIA

Leszi
- 3
- 2
0
votes
1 answer
SAS - Possible to display text using annotate at the same position whithin the graph whichever the size of legend and size of graph?
In SAS, I'm trying to set a 'fixed' position of an arrow to be displayed on a graph. I would like the arrow to be always displayed at the same position, whichever the size of the graph. For now, I'm using annotate to display the arrow, its…

AppyPoint
- 45
- 6
0
votes
2 answers
How to annotate a value from a related model in Django
I have a Post model:
class Post(models.Model, NiceTextPrintMixin):
text = models.TextField()
pub_date = models.DateTimeField("date published",
auto_now_add=True,
…

Roman Safonov
- 11
- 3
0
votes
1 answer
Django Python noob - how do I get the NUMBER out of a Aggregate sum?
I have a simple Aggregate:
tot=PurchaseOrderLine.objects.aggregate(total=Sum('price'))
return HttpResponse(tot)
This returns "total".
If I do:
return HttpResponse(str(tot))
It displays "{'total': Decimal('321.60')}"
How do I get the…

GrantsV
- 3
- 1
0
votes
1 answer
Making labels appear while hovering over plot for graphs *with high y-axis values*, multiple lines and multiple axes
I wanted to read values off of the graphs that I made using python similar to how the data point values show up in an excel plot when you hover over a data point. Using various solutions here, I wrote up the below code to label the points as I…

MezJ
- 5
- 3
0
votes
1 answer
ax.annotate text partially appearing outside the figure box
Apologies, rather unskilled with programming and stackoverflow too. I am drawing bar plots on some data and have managed to add percentages beside the bars, using ax.annotate. However for the bar with highest responses I always get part of the…

sdptn
- 11
- 3
0
votes
1 answer
django-rest-framework annotate relationship
I have spend many hours on google to find a solution, but i'm still stuck with my problem. I have two tables, I'm interested in the latest date related stock_value from the Stock Model. How to set this relationship after annotate?
The Product Tables…

BumDeveloper
- 1
- 3
0
votes
1 answer
How do I bold and underline part of a ggplot2 annotation?
I am trying to use the bold() and underline() functions from grDevices within paste() to create an annotation that features a stylized, hardcoded 'title' with a line break followed by a string that could be one or more lines long, and am struggling…

Bryce R.
- 11
- 3
0
votes
1 answer
Django - MAX ... GROUP BY on ForeignKey to itself
I have a model similar to this:
class Tree(models.Model):
description = models.CharField(max_length = 255, null = False, blank = False)
parent = models.ForeignKey("Tree", null = True, blank = True, on_delete = models.CASCADE)
class…

Christian
- 51
- 1
- 6