New to R, need help with contour-plot

Hi,

I'm new to R, and try to make an contour plot for my master thesis. I get the warning message:
Didn't find a colorbar to modify.
I've tried to read around in different forrums, but did'nt find anything. If there is an easier way to plot an contour plot, with dates in the x-axis, im glad to hear about it.

This is my script:
DOP_dybdeprofil <- read.csv("DOP.csv", sep=";")
DOP_dybdeprofil

xlist <- list(categoryorder="list", categoryarray=DOP_dybdeprofil$Dato)
xlist <- list(c("20.05", "03.06", "15.06", "30.06", "13.07", "28.07", "12.08", "25.08")) #Lagde egen liste for prøvedatoene mine til x-aksen

ContPlotDOP <- plot_ly(data = DOP_dybdeprofil, x =DOP_dybdeprofil$Dato, y =DOP_dybdeprofil$Dybde, z =DOP_dybdeprofil$DOP, type="contour",
ncontours=20,
colors = "ReBu", reversescale=T,
contours = list(showlabels = T), #coloring = "heatmap",
line=list(smoothing=1.3)) %>%
layout(
title = NA,
yaxis =list(autorange = "reversed", title = "Depth (m)",
titlefont=list(color="black", family="Helvetica", size=20),
tickfont=list(color="black", family="Helvetica", size=15)),
xaxis = list(xlist, ticktext=c("20.05", "03.06", "15.06","30.06", "13.07", "28.07", "12.08", "25.08"), showticklabels=TRUE,
tickfont=list(color="black", family="Helvetica", size=18), tickangle=45),
margin=list(b=100)) %>%
colorbar(
title = "DOP",
lenmode = "pixels",
len = 8,
limits = c(0,12),
titlefont=list(color="black", family="Helvetica", size=20),
tickfont=list(color="black", family="Helvetica", size=15), data=NULL)

ggplot(ContPlotDOP)

Thank you for all the answers :smiley:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.