511 questions
0
votes
1
answer
30
views
Cannot place math text (plotmath) in geom_table
The error
Error in as.data.frame.default(x[[i]], optional = TRUE) :
cannot coerce class ‘"expression"’ to a data.frame
occurs when creating a legend for geom_table():
# making table legend
...
1
vote
1
answer
38
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
61
views
Adding manual legend for GGplot with calculated values
First reprex for me here. Couldn't add library(ggplot); hope thats fine.
I created a Bandman-Altman Plot. Now I would like to have the calculated numbers from Mean, Sd, Upper and Lower-Limits written ...
0
votes
1
answer
48
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 ...
0
votes
1
answer
42
views
What does annotate() shift over my geom_text() in ggplot2 when using rich text?
I have 2 plots that I'm joining together. The top shows the raw data and the second is a subjective rating. The issue is that when I try to have a label using annotate() with rich text explaining what ...
2
votes
1
answer
49
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
76
views
Text outside the plot; how to add add a paragraph, selectively bold, and save plot with annotations
I am trying to edit text outside a plot, below the legend. I've followed the instructions suggested here and I've been able to put together the following code
p <- ggplot(Amh2, aes(x=syllable, y=...
0
votes
0
answers
34
views
Why does Prefetch perform better than annotation in django?
Hello I made a code to make it irregular.
tell me why prefetch is faster if I simply import the value, but if I save it, it's faster?
*just import
annotate test: execution time: 1.29 seconds
prefetch ...
0
votes
1
answer
49
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
57
views
ggplot2 faceting and adding unique labels for each facet in a for loop in R
I am trying to add a unique label to each faceted panel in my plots. Below is the code which I annotated and will describe in detail below:
ebird <- left_join(ebird, cor,
by = ...
0
votes
1
answer
70
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
39
views
ggplot2 text in top margin, flipped coordinates
I would like to add some text to a plot in the top margin, but all the solutions I could find messed up the flipped coordinate system after using coord_flip()
var1<- c("ab", "cd"...
0
votes
0
answers
19
views
Adding table to one plot of facet_grid ggplot [duplicate]
I'm trying to add a table to the plotting region of one plot that is part of a larger facet_grid ggplot. My question is very similar to an earlier question, except I only want a plot on panel "A&...
1
vote
1
answer
46
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
1
answer
111
views
Text Alignment in R Magick package
I am trying to align text to its placement coordinate centrally using the magick package in R and image_annotate...
So in this example
#Load Graphic
pb<-image_read("https://art.pixilart.com/...
1
vote
0
answers
49
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 ...
1
vote
1
answer
43
views
How to exclude instances with empty querysets in prefetch_related?
I have two models - Project and Contract.
They have one-to-many relationship.
class Contract(models.Model):
project = models.ForeignKey(Project)
I get a qs of Project instances with relevant ...
0
votes
0
answers
29
views
Defining y value within annotate as value in column after selectInput
I have a plot for each category that can be selected via selectInput. In each plot, there is a horizontal line that indicates the control mean. The height of this line changes for each category. The ...
0
votes
0
answers
39
views
Jupyter Lab in AWS SageMaker | Interactive Visualizations | Unable to display Tool Tip when Hover over Data Points
Followed this article which guides with example code for building scatter plot with Annotations. This worked like a charm in Jupyter Notebook.
When Tried the same code in Jupyter Lab unable to run it ...
0
votes
1
answer
91
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
1
answer
37
views
Plot arrow outside of figure instead of inside
I am trying to plot the arrow outside of the figure. I have tried a number of different options, but they keep plotting the arrow inside the figure. Is there a way to plot it outside the bounding box?
...
1
vote
2
answers
29
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
201
views
How to add multiple labels to faceted ggplot outside of the plot?
I use facet_rep_grid to visualize different variables over the same x-axis. Now I would like to label the top left of each facet with "A", "B", "C" etc.
what i have looks ...
1
vote
1
answer
45
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, ...
0
votes
1
answer
559
views
Multiple points with same label in ggrepel - avoid redundant labels
I want to annotate a scatterplot with several points that have the same label. I want to label all of them (not just a part of them) but it is a mess with so many redundant labels.
Is there any way to ...
2
votes
1
answer
207
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, ...
0
votes
1
answer
73
views
Django annotate with Count on subquery with OuterRef failing
TLDR:
Lets hit overall problem here 1st:
How in django annotate queryset with a Subquery that uses OuterRef and count how many objects subquery returned (for every object in original query)
Pseudocode:...
1
vote
1
answer
41
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 ...
1
vote
1
answer
196
views
Customizing look of table inserted into a ggplot
I want to annotate a table to an existing ggplot with a specified theme.
However, I'd like to adapt the look of the table and change the color of the gridlines and the background color of the table ...
0
votes
1
answer
61
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
0
answers
112
views
yard and annotate for models in a namespace
I am trying to use the annotate gem with the -f yard option. This works quite well for models in the toplevel of the folder. However a lot of my models are in a namespace. The annotate gem will create ...
0
votes
1
answer
36
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 =...
0
votes
1
answer
52
views
Place (x,y) coordinate pairs in ggplot annotation label
I have a ggplot I'm using to illustrate some trig concepts via an RMarkdown document.
annotate("text",
x = 0.97,
y = 0.5,
label = str_c("(~frac(...
2
votes
1
answer
128
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='...
1
vote
1
answer
78
views
Django: TruncDate datetime retunrs always datetime
I'm using Django 3.2.12 and mysql 8.0.27 for Win64 on x86_64 (MySQL Community Server - GPL) and have this models
class Anomalie(models.Model):
dateajout = models.DateTimeField(auto_now_add=...
0
votes
2
answers
298
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
0
answers
42
views
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 ...
0
votes
1
answer
39
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 ...
0
votes
1
answer
155
views
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 ...
1
vote
0
answers
551
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
1
answer
207
views
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", "...
0
votes
2
answers
1k
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 ...
2
votes
1
answer
501
views
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. ...
0
votes
0
answers
255
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
35
views
Multiple graphs have problem when use annotate
I have a data set (generated as below) and made 3 graphs G1, G2, G3 (codes are below). When I print a graph after creating it there is no problem. However, If I print them after all of them created, ...
0
votes
1
answer
572
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 ...
2
votes
1
answer
467
views
How to plot or show multiple images in a row using julia?
I'm new to Julia and I used MNIST handwritten digit train data to get multiple images in matrix with size 28 x 28. Let's assume I store them in array img[i] with length n(n is dynamic). I want to show ...
0
votes
1
answer
105
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 ...
2
votes
0
answers
59
views
Matplotlib figure coordinates don't seem correct
As per the block of code below, using ax.annotate() it appears that the outer extents of the Figure object are not properly captured by figure fraction. I would expect the arrows to point right to the ...
1
vote
2
answers
78
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):...