Fixed axes in plots, esp. ds.heatmapPlot

Hey all,

we were wondering if there is a workaround to set the axes of DataSHIELD plots with which one can set something like xlim = c(-5,5) and ylim = c(0,10). In the project I am talking about we are still working with version 4.0.

Thank you and all the best

Caroline

Hi Caroline,

What kind of plots do you want to generate? In general, the graphical functions of DataSHIELD do not allow all possible arguments that are exist in native R graphical functions such as the xlim and ylim. However, you can create an object of your plot by assigning to it a name, and then use the R plot function to change the ranges of axes.

Here is an example:

hist <- ds.histogram(x=‘CM$age.60’, type=‘combine’)

plot(hist, xlim=c(-100,100), ylim=c(0,1000))

1 Like

I forgot to say that versions 5.0 and above of DataSHIELD include updated versions of the graphical functions in addition to many other new functions and improvements to old functions, so I suggest you to consider an update of your DataSHIELD packages!

Demetris, am I right in thinking the new graphical functions’ server side part also require a new version of the Opal server? Stuart

Yes Stuart, that’s right. The new versions of graphical functions require the creation of a study-specific seed random number generator which is a feature of Opal version 2.14 (and higher). The new versions also need the installation of the “RANN” R package on the server-side.

Thank you Demetris for pointing out such an easy way!

1 Like