Plotting Temporal Localization Part 6 - veeninglab/BactMAP GitHub Wiki
Now I use my new trajectory dataframe containing both DnaX and
FtsZ data to plot the fluorescence localization over time using plotTracks()
.
You can use plotTracks()
in multiple ways. First, I want to make a plot
which has a similar layout as the kymographs, showing only the localization on the
cell length
axis over time
. I can do this by putting the variable dimension
to
length
in the plotting function.
The input I use here for
plotTracks()
is themesh
data myMesh and thetrajectory
data combo.
myTrackPlot <-
plotTracks(myMesh, combo,
tracks=TRUE,
cell=4,
mag="100x_DVMolgen",
dimension="length")
myTrackPlot
The only thing which I still want to change is the colors. The standard
colors which plotTracks()
uses for mult-color tracks is the CUD colorblind-friendly palette
. However, for
this picture, I want the colors to match the viridis palettes of the
Kymographs, so I selected two color values from the heatmaps using a
color picker.
R recognizes hex-codes and a whole list of color names, so you can exchange what I put below for any of these (for instance, "burlywood1" or "cornflowerblue", if you wish).
reddish <- "#B63679FF"
greenish <- "#21908CFF"
Now I’ll use the ggplot2
-function scale_color_manual()
to change the
color map. Note that I also flip the plot upside down to match it to the
kymograph:
myTrackPlot + ggplot2::scale_color_manual(values=c("DnaX"=greenish, "FtsZ"=reddish)) +
ggplot2::scale_y_reverse()
⬅️ Plotting Temporal Localization Part 5: Plotting Fluorescence Trajectories: Preparation | Plotting Temporal Localization Part 7: Plotting Fluorescence Trajectories: Two dimensions ➡️ |
---|