Use this tag for questions related to annotating plots, e.g. adding descriptive labels or annotations to data points.
Questions tagged [annotate]
490 questions
1
vote
1 answer
simpleXML xs:choice element
I have the following:

Bugz
- 118
- 1
- 9
1
vote
1 answer
Django Maximum Value From Merged Table Columns
I am trying to get the maximum value from merging the results from two separate tables. I am trying to get the most updated comment for a Post. I have a model Comment that can be accessed by Post.comments. I also have a body that is separate of…

garromark
- 814
- 8
- 20
1
vote
1 answer
How do I get the number of posts on each day with annotation in Django?
I have a Post model that has a datetime.date field for posted_date. I need to find how many posts are made by a user on each day. Creating a query for each day seems silly.
I couldn't figure out how to make the aggregation API query using…

damon
- 8,127
- 17
- 69
- 114
0
votes
1 answer
annotate() adding more than needed
I'm having a small issue with my annotate(sum()) function. Now what I want it to do is show a total for all maturities in the given plan, inside the list. Which for the first one it does. Code below:
#get the invesments maturing this year
…

TheLifeOfSteve
- 3,208
- 6
- 37
- 53
0
votes
0 answers
add unit in ggplot2 label
I want to add label in ggplot2 through function annotate.
Before I done this by annotate(... label = "a"~'='~100~t~y^-1",...). Now I use letter 'df' to represent 100, and the code is label = paste("atop('a = '*", df,")").
Is there any way to add…

Guo DJ
- 1
0
votes
2 answers
ggplot add date labels to x axis whilst using numeric x values
I would like to reproduce the following plot, but I would like to add date labels every 4 months instead of numeric.
I had to convert the date_time values to numeric in order to plot the annotate("rect") as I wanted it to extend the length of the…

mrob27
- 61
- 6
0
votes
0 answers
Annotate line graph
I am attempting to make a line graph showing home value change over the six months before a hurricane and the six months following a hurricane. I would like to add markers to each line with the value of the home at that time. I have the home value…

Sam Grasland
- 1
- 1
0
votes
1 answer
Annotating only unique duplicated key values on a diverging bar chart in ggplot2
Say I have a dataframe (df) with a total of 2 columns and 40 rows. The first column have duplicated key/ID values and the second contains 20 positive values, followed by 20 negative ones.
Because of this, I decided to go for a diverging bar chart.…

ginn
- 87
- 5
0
votes
1 answer
Avoid cut geom_label() with facet_wrap()
in the plot below I have data distributed into four groups separated via facet_wrap(). However, these groups have an uneven distribution of the data, hence, all groups have different bar sizes.
How can I avoid cut the geom_label() of groups one and…

Larissa Cury
- 806
- 2
- 11
0
votes
0 answers
How to add a rectangle to a ggplot graph with a logged y-axis without changing the y-axis scale
I am trying to add a rectangle to a ggplot graph with a logged y-axis using annotate() or geom_rect(). The rectangle is bounded by two x-axis values (which are dates) and needs span the enitre y-axis. However, whenever I add the rectangle, it…
0
votes
1 answer
Multiple titles/labels on y-axis in ggplot2
I have a data frame that looks like this:
variable <- c("Financial wealth", "Financial wealth", "Financial wealth",
"Financial wealth", "Financial wealth", "Financial wealth",
"Financial wealth", "Financial wealth",…

MF1992
- 63
- 4
0
votes
2 answers
Annotate ggplot with multiple coloured text annotations the same as the legend / plot features
I'm trying to annotate a ggplot that shows multiple results of the same response on different days. When I plot the data, I set col = day in the aes command. How do I annotate the ggplot with mean values of the response on each day using the same…

A.Benson
- 465
- 1
- 6
- 16
0
votes
0 answers
Django: How can I use subquery and annotate with 2 tables in 2 different databases in Django?
I have Table 1 in database1 and Table2 in database2.
I try to use annotate and subquery like bellow but it's not work.
from django.db.models import Subquery, OuterRef, Count
from app1.models import Table1
from app2.models import Table2
subquery =…

Manh Do
- 1
- 1
0
votes
0 answers
How to use a dictionary with annotate in django?
I have a model:
class Hero(models.Model):
# ...
name = models.CharField(max_length=100)
category = models.ForeignKey(Category, on_delete=models.CASCADE)
benevolence_factor = models.PositiveSmallIntegerField(
help_text="How…

Manh Do
- 1
- 1
0
votes
1 answer
Wrapped Caption on Arranged Plot
I am trying to put 4 plots together and add a long caption (Figure caption) underneath of the plots. However, when I try to add the caption, it puts the wrapped caption over top of the graphs. Additionally, there is a part of my caption that needs…