37,826 questions
-1
votes
0
answers
47
views
Error plotting global shapefile over the dateline in R [duplicate]
I am trying to plot a global dataset of seamounts (full shapefile data can be found here).
seamounts <- st_read("YessonEtAl2019-SeamountBases-V2.shp")
I want to plot it centred on the ...
4
votes
1
answer
94
views
Tick direction of 3D plot in Matplotlib
In Matplolib, it is possible to change the direction of the tick of 2D plots with tick_params parameters
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
fig ...
-2
votes
0
answers
72
views
Numpy's np.polyfit() returns matching types Error? [closed]
I have a dataTable that is a list of lists. Every one of those lists is a list of different data. The first list containes the year, the second is data about 'poverty' for every one of those years, ...
Tooling
0
votes
1
replies
35
views
Real-time interactive plotting options
I have a C++ data processing program. I want to view a live plot of a stream of data that is being produced in the program, for debugging purposes. I'm not looking for a production-ready plotting ...
1
vote
2
answers
146
views
Customizing label format in facet nested plots with ggplot2
I am trying to create a series of plots using ggplot2 in R, and I want to customize the labels in the facet nested plots, particularly to include subscripts for the ICC labels. Below is my attempt, ...
2
votes
2
answers
105
views
How to change x-axis tick labels when plotting decomposition in R?
I am using the stR package to decompose an msts time series.
When I call:
library(stR)
library(forecast)
msts_spain <- msts(
spain_daily$Daily_Load,
seasonal.periods = c(7, 365.25),
start = ...
0
votes
1
answer
97
views
Build forest plot for estimate comparison of multiple models using ggplot2. How to add text of CI?
I am trying to create a forest plot to compare estimates of different models.
Tho goal is to plot all the estimates of the same predictor for the different models so they are comparable.
For this I ...
0
votes
0
answers
31
views
dynamic animation in paraview
I need to animate the movement of a cylinder in space. I have the x, y, and z coordinates as a function of time in a CSV file. Since it's very large, I can't create the animation manually. Is there a ...
0
votes
0
answers
84
views
Creating Estimation Plots in R with multiple variables
I have a mixed model that includes three different variables: Treatment, Stimulation, and DRG, as well as a random effect with DRG nested under a group ((1|Group/DRG)). I am looking to assess how each ...
1
vote
1
answer
72
views
How to create a stacked coefficients plot for multiple linear models in R?
I'm attempting to create a coefficient plot for multiple linear models using ggplot2 in R, but I'm facing an issue with overlapping points and error bars when displaying the estimates.
I've written a ...
0
votes
1
answer
89
views
stat_regline_equation() doesn't match stat_smooth() line
I'm getting an odd problem where I've attempted to plot a scatter graph and fit a quadratic regression line to it. I used stat_smooth() to make the line, and stat_regline_equation() to print the ...
3
votes
0
answers
104
views
How can I plot diagonals of matrix?
I want to plot all the diagonals of a matrix. In the matrix row 1 contains information of time 1, row 2 of time 2 etc etc. Each diagonal presents the evolution of the number of fishes in a cohort that ...
0
votes
0
answers
81
views
Plotting xts object in loop fails [duplicate]
I want to plot several time series (xts) in R in a loop. However, that does not work, I only get "empty" devices. So I wrote a little test:
library('xts')
testdata <- c(1:100)
testdata....
8
votes
2
answers
310
views
How to draw a double line in ggplot
How do I make the line in the graph above a double line like shown in below?
Some example code:
df <- data.frame(dose=c("D0.5", "D1", "D2"),
len=c(4.2,...
1
vote
1
answer
105
views
'facet_nested' displays incorrect labels and missing nest lines
I'm trying to create a nested facet plot in R using ggplot2 and ggh4x with the facet_nested function. I'm plotting a boxplot of a simulated dataset and want to facet the plot by x2 while grouping x1. ...
0
votes
1
answer
104
views
How to annotate with label in middle?
When I plot the following code with 3 subplots using matplotlib,
import numpy as np
import matplotlib.pyplot as plt
# ======================================
# Base ellipse parameters
# ==============...
0
votes
1
answer
57
views
Logistic regression, print several curves on the same graph
I'm working on a project, and I need to do a graph where there is two curves of logistic regression. I'd like to display the curve of the disease status (encoded by 0 and 1), along with the Age (...
2
votes
0
answers
128
views
PyQt6 QWebEngineView 3D Plot Fail To Render With Large Data
I'm working on an antenna 3D polar plot program which need to render real-time plot.
Things I'm using:
Python 3.11.9
PyQt6 6.9.1
PyQt6-WebEngine-Qt6 6.9.2
plotly 6.3.1
Issue:
The code can generate ...
1
vote
1
answer
67
views
Combining lines in a predicted probability plot without changing the regression model
I have a dataset with a binary outcome income and two continuous predictors, age, and education_num. I'm fitting a logistic regression model with a natural spline for age and an interaction with ...
0
votes
1
answer
80
views
Why do my labels and highlight points plot far from the data in tidyplots boxplot?
I'm using tidyplots to highlight and label extreme values in a boxplot, but the labels and points appear far from the actual data. Here's a minimal reproducible example.
pacman::p_load(dplyr, tidyr, ...
2
votes
2
answers
115
views
Jitter points next to boxplot [duplicate]
Is there a way to plot all points as a jitter next to (not underneath or on top) of a box plot in ggplot2? I can move the points to one side or change the width of jitter, but not both.
Edit: Using ...
2
votes
1
answer
55
views
Can't get the x axis tick label to appear
I've been trying hours to show the x axis label in my GraphRAG plot. The below is similar to my actual code but when I run this, the x axis label just doesn't appear?
I am not sure if it's because the ...
1
vote
1
answer
65
views
gnuplot 6.0 animation not updating
I've never used stack overflow before, but I don't know who else i can go to for this, so apologies if I don't provide all relevant information.
I am using "gnuplot 6.0 patch level 3 console ...
0
votes
0
answers
54
views
How do I set the size for the condition specified in "by" with visreg?
This is my code:
par(mar = c(6, 9, 6, 2), mgp = c(5, 1.7, 0))
visreg(
model,
"decade",
by = "altitude.ranges",
overlay = TRUE,
scale = "response",
breaks ...
0
votes
0
answers
47
views
altair plots do not show axis properly
I am trying to recreate altair plots to check my setup and it does not plot the axis ticks and labels. Is there a cached config or settings that I need to clear?
source = pd.DataFrame({
'a': ['A', ...
0
votes
2
answers
58
views
Python matplotlib showing jagged graphs for constant value functions
I was trying to plot a function with absolute values and it's piecewise counterpart, but matplotlib was ploting the function with jagged corners.
Here is my full code:
import matplotlib.pyplot as plt
...
0
votes
1
answer
150
views
how can I access particular y and x axis using ax = fig.add_subplot(3, 3, i +1), for a loop on i?
It seems accessing axis is easy with
fig, ((ax1, ax2,ax3,ax4)) = plt.subplots(2, 4,figsize=(10,8),layout='tight')
subfigs = fig.subfigures(2, 4)
For example, if I want the ticks (labeling too) on the ...
0
votes
0
answers
70
views
Why is my plot of the cost function like this and not like a bowl?
My code:
def calc_cost_function(w, b, data):
m = len(data)
cost = 0
for i in range(m):
x = data.iloc[i].X
y = data.iloc[i].Y
cost += ((x * w + b) - y)**2
return ...
0
votes
0
answers
85
views
How do I make a mark_rule that stops at a previously defined line?
I've plotted a curve which involved some transform calculations, and now I want to place a vertical rule at a specific x location that stops at the height corresponding to that line.
This is what I'...
2
votes
1
answer
99
views
How can i set the ticks of ax and ax2 to the same position but I have different scales?
I have this python code snippet that sets the ticks of the two y-axes. But I can't figure out how I can synchronize the axe's scales.
if y_data_left:
all_left = pd.concat([y for _, y, _, _ in ...
1
vote
1
answer
98
views
Trouble Plotting short term Solution on Maple
I’m trying to solve a problem from Modern Mathematical Methods for Scientists and Engineers using Maple, specifically applying the Fokas method (Unified Transform) to the heat equation on the half-...
3
votes
1
answer
115
views
Unable to zoom or hover map using nested subplot()
My interactive dashboard where multiple Plotly objects including maps are displayed using nested subplot() in R:
library(digest)
library(sf)
library(jsonlite)
library(plotly)
library(ggplot2)
library(...
2
votes
1
answer
78
views
altair mark_area() with unexpected behaviour of y2
I'm trying to make an area chart of a CDF plot (which should be always increasing), instead I get the result in the image below.
import altair as alt
import polars as pl
_data = pl.DataFrame({"...
-4
votes
1
answer
101
views
Adding pre-existing log equation to plot
I have a dataset in R that I've already plotted and fitted a logarithmic model to. I'd like to add an additional line on the graph comparing the logarithmic model to a different log equation that I ...
1
vote
0
answers
56
views
"Error Occured while plotting the chart" - Custom View dashboard in SAP APIM
we are getting an error while monitoring the custom view dashboard in SAP APIM.
While navigating through the dimensions , Custom_error_text1 (Error_Message in API) --> Custom_error_time (...
3
votes
1
answer
82
views
Error "x must be numeric" on numeric variables when using histBy()
I'm trying to draw histograms of a DV (minutes) for each level of the IV (group) using the histBy function in the {psych} package.
My dataset contains 3 variables, all of which are numeric. There are ...
0
votes
2
answers
102
views
Place the shared legend inside the plot grid as opposed to besides it [duplicate]
I have 3 plots that I want to arrange in a 2x2 format. They all share the same legend, and I want to place the legend in the bottom right space, where a fourth figure would fit. So far, I have tried ...
4
votes
2
answers
90
views
Show only selected labels in circular dendrogram
I am trying to plot some dendrograms using dendextend package in R.
How to show only selected labels in a circular dendrogram?
library(dplyr)
library(dendextend)
mtcars %>%
select(mpg, cyl, ...
1
vote
2
answers
119
views
Plotting characters from the Hershey fonts (package) using R's base plot
This question originates from: r - How to plot alphabets? which is where I came across the hershey package and the vignette. I tried the following:
string_df <- hershey::create_string_df(text = &...
1
vote
1
answer
86
views
check_model() plotting twice when plot_annotation() is used
I am having trouble sending a performance::check_model() to a pdf (or the plot window) without it printing twice when I add a title with patchwork::plot_annotation(). check_model is supposed to use ...
2
votes
1
answer
139
views
Robinson projection of two global raster data from two sources
I tried to access global elevation raster data from two sources:
Source 1 (Natural earth):
I downloaded raster data of world elevation from here: https://www.naturalearthdata.com/downloads/10m-raster-...
1
vote
1
answer
109
views
How to edit title/axes of already compiled matplotlib plots
I expect the answer is "not possible". I am compiling some matplotlib plots that take a long time to produce. The plots are generated based on data that also takes a long time to produce, ...
1
vote
0
answers
127
views
How to reduce compilation time for complex ggplot graphics
I have a graphic in ggplot that takes too long to compile. Actually, the plot does not appear and I have to force R to stop the compilation. As far as I know, the code has no error, but perhaps due to ...
2
votes
1
answer
109
views
Change of basis for log-log plotting, grid in log-scale
I want to plot in log scale in both axis, when using the default base, the graph plotted is correct, but since the y variation of my data is small I would like to change for base=2, when I does this ...
1
vote
1
answer
43
views
Set color scheme for each chart in column layout individually
Consider the following example of a bar plot in horizontal layout. In each chart the y and color channels both encode column "y" of df.
import altair as alt
import numpy as np
import polars ...
1
vote
1
answer
40
views
Set color map for bar plot while using the `color` encoding channel
In the below example, I create an bar plot, with the height and the color of the bars both encoding the y column of df. The bars then appear in different shades, for very light to very dark; in blue.
...
1
vote
1
answer
108
views
How can I force longitude axis labels to display correctly with coord_sf() in ggplot2 (ticks at 160–180°E)?
I'm trying to plot a map of New Zealand using ggplot2 and sf, showing outer islands as well. I want the x-axis to show longitude ticks from 160°E to 180°E at 5-degree intervals, and the y-axis to show ...
2
votes
2
answers
96
views
Formatting my boxplots with correct labels
I have 6 boxplots. 2 rows, three columns. Here are my boxplots so far:
I want to format my boxplots so that the top and bottom graph shares one Y-axis label. Both x-axis labels should move to the far ...
0
votes
1
answer
94
views
In matplotlib 3D line plots, how to ensure lines that are behind actually appear behind those drawn later?
I am plotting families of orbits in python using matplotlib and the add_subplots() routine:
fig=plt.figure()
ax=fig.add_subplots(projection='3d')
I then loop through my list of [X,Y,Z] series and ...
1
vote
0
answers
111
views
PCA with direction arrows showing genes associated with samples
I’m trying to reproduce a PCA biplot where
dots = samples coloured by the column sample in pb.obs
arrows = genes, pointing toward the region(s) of the plot where each gene is most highly expressed.
So ...