0

Surely there is a simple solution but I cannot figure it out...

I am trying to plot 2 dependent variables on the sample ggplot plot, grouped by temperature.

I can plot them both separately but not together.

I basically want to plot two concentrations of calcium (from differing equations) depending on 4 constant temperatures and pressure.

FYI: Tc = temperature (colour group), PCO2 = pressure (x axis), Calcium1: concentration using eq 1, Calcium2: concentration using eq 2

My attempted code looks like this:

(ggplot(data=DCa)

  • aes(x="PCO2", y="Calcium1", color="Tc")+ geom_line(aes(group="Tc"))
  • aes(x="PCO2", y="Calcium2", color="Tc")
  • geom_line(aes(group="Tc"))
  • ylim(0.0, 2.0)
  • labs(x="PCO$2$ (atm)", y="[Ca$^{2+}$]${app}$ (mmol/L)", color='T $\degree$C') )

The output is only showing "Calcium2" results. ggplot output

Does anyone know how to show both concentration groups?

Ellen_B
  • 1
  • 1
  • Welcome to SO! Please provide some of your data so others can help you. For tips on asking a good question with a reproducible example of your issue, see [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). – Dan Adams Feb 14 '22 at 01:40
  • Are you working in `python` or `r`? If you're using {ggplot2} natively in `r` you should tag your question appropriately to get the best help. – Dan Adams Feb 14 '22 at 01:42

0 Answers0