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

ggplot: add mathematical expression to different facets in different position

I'm trying to add different texts to different facets but since the scales are different, I'd like to position them in the appropriate places for each facet. geom_text allows me to play with the position but couldn't turn the r^2 into a mathematical…
Guy
  • 3,535
  • 2
  • 12
  • 9
0
votes
1 answer

Perl - How do I resize and annotate with Image::Magick with a "system" call?

Image::Magick system("convert $imageurl $new"); system("convert $new -geometry 480x360 -blur .8 -quality 100 $new"); and system("convert $imageurl $new"); system("convert $new -resize 480x360 -blur .8 -quality 100 $new"); Both the above work fine…
0
votes
2 answers

Aesthetics must be either length 1 or the same as the data (1)

I am trying to mix annotate and expression statements in ggplot2. I'm getting a consistent error "Aesthetics must be either length 1 or the same as the data (1)". My first thought was that I had the wrong number of variables in aes. That might…
SteveM49
  • 61
  • 1
  • 1
  • 5
0
votes
0 answers

Gem 'annotate' isn't annotating STI models with enum

I am using STI on 'users' table with models. Users model has one enum 'gender' with values [:male, :female, :other]. #app/models/users.rb class User < ApplicationRecord enum gender: {male: 0, female: 1, other:…
Gaurav
  • 111
  • 2
  • 8
0
votes
1 answer

Django annotate in template

I am working on a small project in which occupations posted are to be ranked. Ranking is on the basis of the number of times an occupation is posted. I have managed to query the data and rank the occupation. However in the template when I try…
0
votes
2 answers

django-table2 and django annotate issue

I have a use case in django_tables2 with django.db.models Sum, but can not figure out the usage after reading django doc with aggregation, I am wondering whether that is possible: # models.py class AModel(models.Model): a_id =…
zhihong
  • 1,808
  • 2
  • 24
  • 34
0
votes
0 answers

Highlight text using Javascript

I am trying to do below thing. User will select text on webpage and then I want to highlight that text using some color. And also I want to store that information to database so when user come to that page again I can show already highlighted…
coder
  • 1
0
votes
2 answers

How to use GROUP BY in Django ORM

I am stuck in a situation where I need an equivalent Django ORM for the following sql query. Please help, I am new to django. SELECT column1, column2, sum(column3) as total FROM table1 GROUP BY column1; I have tried…
jonathan
  • 33
  • 5
0
votes
0 answers

django: annotate on groups then join back (as pandas groupby + transform)

In a django setting, given a table with columns `id`,`x`,`y`,`z` I need to groupby on y find the maximum value of z in each group join the outcomes back such that I end up with a table reading id,x,y,z,max_z I managed to get the group maxima…
Acorbe
  • 8,367
  • 5
  • 37
  • 66
0
votes
1 answer

Django annotate F() / F() "rounds" unexpectedly

I have a Django 1.9 queryset qs to which I add the following annotations: qs = qs.annotate(total_messages= Sum(Case(..., output_field=FloatField())) qs = qs.annotate(spam_messages= Sum(Case(..., output_field=FloatField())) qs =…
Se Norm
  • 1,715
  • 5
  • 23
  • 40
0
votes
1 answer

Django ORM annotate with filter

I need to get post or comment count about user in specific group. So, I use this code. It works well. if model == 'post': return _group.fbuser_set.filter(posts__group=_group).annotate(count=Count('posts')).order_by('-count') else: return…
egaoneko
  • 389
  • 1
  • 5
  • 24
0
votes
1 answer

Edit a gradient legend to indicate a pre-defined benchmark value

Have a quick look at the plot below... I'd like to add an indicator on the gradient bar in the legend that corresponds to a predefined benchmark % (17%, which is the range indicated by the blue band). It should be a simple horizontal band, with some…
Alex
  • 971
  • 4
  • 15
  • 28
0
votes
2 answers

How can I annotate a deleted file in git?

I want to annotate/blame a file in a git repository on a revision using the following command: git annotate [options] file [revision] However, the file does not exist in the current repository anymore, but I know that the file was exist in revision…
Justin Civi
  • 893
  • 1
  • 9
  • 15
0
votes
1 answer

MatPlotLib Python 3.4: Enumerate and ax.annotate

I have constructed a horizontal bar chart as show with the code below. Everything looks great except what are supposed to be annotated bars. I can't figure out how to get the labels on the end of the bars and not in a table in the middle of the…
Dance Party2
  • 7,214
  • 17
  • 59
  • 106
0
votes
1 answer

How to annotate rails engine models with annotate_models gem?

I can annotate my models using annotate --exclude tests,fixtures,factories,serializers How can I annotate models inside my rails engine? I tried using annotate --model-dir ../your-engine-name/app/models but it didn't work.