507 questions
1
vote
1
answer
563
views
How to extract bounding box coordinates from grounding dino's predict function?
The boxes returned by the predict function doesn't seem to be of normalized form, even after multiplying with the image width and height i can't get the coordinates of the bounding boxes.
import torch
...
1
vote
1
answer
48
views
axis annotations and text do not show up for specific data inputs
Using matplotlib in python I have the issue, that for specific inputs axis annotation and axis labels are not shown.
I wrote the following code:
df = pd.read_csv(os.path.join(input_path, "data....
0
votes
1
answer
53
views
matplotlib annotate text incorrectly placed
I am trying to create a stacked bar chart with annotations using pandas plot method. Actual placement of text in the chart is not in line with the xy coordinates. I have tried various values of ...
1
vote
1
answer
51
views
Making relative position of annotation on gvisGeoChart fixed on different sized screens
I'm still trying to find a workaround for this question: Inserting text on either side of colorAxis in gvisGeoChart instead of numbers for Shiny app
As far as I can tell, it is not possible to (1) add ...
0
votes
1
answer
78
views
Highlight areas of interactive time series plotly plot where y is greater than defined threshold and annotate them
I would like to highlight sections of plotly plot that have values higher than a certain threshold and annotate them. As I am manually screening each highlighted area on the plots is there a way I can ...
0
votes
1
answer
78
views
Annotating each point on the graph on a loop with matplotlib
I am trying to annotate each point the graphs on the loop with the country but can not figure out how to di it in a loop.
Here is the code:
import pandas as pd
import matplotlib.pyplot as plt
import ...
1
vote
1
answer
50
views
Django group by after annotate does not work
I have the following Django models:
class Order(models.Model):
...
org_slug = models.CharField()
class ProductToOrder(models.Model):
order = models.ForeignKey(Order, on_delete=models....
1
vote
0
answers
56
views
Changing arrowhead style of 2 of the six vectors in a 3D plot
I would like to lay emphasis on the fact that two of the vectors pointing towards one specific point (environment) are different from the other vectors. I thought of doing so by changing the arrow ...
0
votes
1
answer
158
views
Use hover inputs to annotate a ggplot in Shiny?
I am working on Shiny app. One of the plots in my app is an area plot of Chicago evictions over time. I have permanent annotations on the plot for the peak and most recent values in the data (2012 and ...
1
vote
2
answers
32
views
How to annotate field for the right sorting
I annotate queryset in Django like this:
q_set = q_set.annotate(
period=Concat(
ExtractYear(date_field),
Value(' - '),
ExtractMonth(...
1
vote
1
answer
49
views
annotate box to follow legend position ggplot2
My data:
plot_data <- structure(list(date = structure(c(18993, 18994, 18995, 18996,
18997, 18998, 18999, 19000, 19001, 19002, 19003, 19004, 19005,
19006, 19007, 19008, 19009, 19010, 19011, 19012, ...
2
votes
1
answer
306
views
Add regression line equation to facet_wrap in PLOTNINE
I'm trying to add equation of the linear equation fitted to the plotted data. I have used geom_smooth and method 'lm' with formula = 'y~x'. add eq to single plot shows how to it to a single plot, ...
1
vote
1
answer
58
views
Annotate text on individual facet multiple times
I came from this post answering on how to add text to text to the plot. However, my problem goes beyond because I need to add text multiple times in multiple locations. The annotate functions seems ...
0
votes
1
answer
68
views
How to plot results from median_test using ggplot annotate in R?
I have a simple set of data (length of stay in hospitals) which is separated by "Low" and "Normal" groups.
The median is the statistic used to represent this data and I'd like to ...
0
votes
1
answer
39
views
Showing value labels in axes 2 in line chart [duplicate]
I've show the y1 label using plt.annotate, but I couldn't do the same for the y2. Could you help me?
plt.figure(figsize=(10,4))
x = [201901, 202001, 202101, 202202]
y1 = [6.86, 21.45, 6.25, 0.88]
y2 =...
2
votes
1
answer
193
views
How to resolve this waring: is.na() applied to non-(list or vector) of type 'expression'?
The following R code
library(ggplot2)
ggplot() +
annotate("text", x = 1, y = 1, label=expression(paste("model 1, ", italic(R)^2, ": 0.50")),
size = 14/.pt, col='...
0
votes
2
answers
377
views
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(&...
0
votes
1
answer
48
views
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 ...
1
vote
0
answers
606
views
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. ...
0
votes
2
answers
2k
views
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 ...
0
votes
0
answers
329
views
R ggplot2 annotate fails
I have a script in R that is doing a print of graphics automatically in form of a loop. I try to implement into the ggplot an annotation using annotate. But it doesn't work.
Here's the code:
sp<-...
0
votes
1
answer
742
views
How to set xytext as starting point for annotate arrow using matplotlib?
I would like to gain more control over the starting point of the annotation arrow in Matplotlib. It seems like the arrow starts at the center of the bbox of the annotation text. However, in many cases ...
0
votes
1
answer
120
views
ggplot annotate brakes axis
I want to insert a text into my ggplot chart. The text got a subscript and a supersubscript like X[X} = 1,00*Y R^2 = 0,90. For that I used the function paste(expression()) into annotate(label=()).
In ...
1
vote
2
answers
87
views
Django multiple table query - convert MySQL to Django (Python) query
I need to figure out how to translate MySQL query into Django (Python) language. Any help? Basically I need to get the total from each table plus the remain total after spend.
class Trip(models.Model):...
1
vote
1
answer
455
views
Left alignment title in arrange function in R
How do I adjust the title to the left? And also, in the annotate_figure can I create a subtitle? Instead of cutting the line \n, as I don't want the subtitle in bold.
I am using the arrange function ...