Q:

How to plot distributions of two different breeds

I setup two different breeds with the breed command:
breed [breeds1 breed1]
breed [breeds2 breed2]

and in go, I ask to a random turtle to execute an action command, like this:
to go
ask one-of turtles [
   action
  ]
end

where action is defined as 
    to action
      ifelse (breed = breeds1) 
      [
        set q random-float 1
        set c q
        set potential_1 (1 + d) * (1 - c)^(d)
      ]
      [
        set c random-float 1
        set potential_2 (1 + (1 / d))*(1 - c)^(1 / d)
      ]
    end

For breeds1, q has value in [0,1] and c takes its value. 
For breeds2, q has value equal to 0 and c takes random values in [0,1]. 
Both breeds have d=3 (fixed value). 
c,q, and both potentials are global variables. 
What I need to do is to plot the two potentials/distributions.
I used plotxy to plot the distributions in the plot code box:
[![enter image description here][1]][1]
What I would like are the following two distributions in the same plot. Plot 1 shows the distribution for breeds1, plot 2 for breeds2. 
If I consider potential_1 and potential_2 as turtles-own (the first one for breeds1, the second one for breeds2) I receive the message that I can't use potential_1 in an observer context, because potential_1 s turtle-only. Same for potential_2. 
If I consider q and c as turtles-own  as following: 
breeds1-own
[ q
  c
  potential_1
]
breeds2-own
[
  q
  c
  potential_2
]

I receive the following error:

You can't use c in an observer context, because c is turtle-only

So my question is: how could I plot the two distributions?
I hope you can help me. 

A:

Okay, I can't answer your question using your code as I can't work out the logic of the ask one-of. So, what I have done instead is created a complete model that does the plotting in the hope that will help you work out what's wrong with your code.
Try this:
globals [d]

turtles-own
[ potential
  group
  c
]

to setup
  clear-all
  set d 3
  create-turtles 100
  [ set group one-of ["type1" "type2"]
    action
  ]
  reset-ticks
end

to action
  ifelse (group = "type1") 
  [ let q random-float 1
    set c q
    set potential (1 + d) * (1 - c)^(d)
  ]
  [ set c random-float 1
    set potential (1 + (1 / d))*(1 - c)^(1 / d)
  ]
end

Then you will need the following as the pens in your plot. You will also need to change the plot settings for each pen to 'point' rather than 'line'.
ask turtles with [group = "type1"] [plotxy c potential]
ask turtles with [group = "type2"] [plotxy c potential]

What I have done is create 100 turtles in two groups, with the values of the variables 'c' and 'potential' calculated for each group using your code. But it's all done in a single pass - each turtle does its calculation and then control moves to the next turtle as they are created. Then I have each pen in the plot just plot the values from one group.
The error message you were getting "You can't use c in an observer context, because c is turtle-only" means that you tried to use the variable c without letting NetLogo know which turtle's value of 'c' you wanted to use. 

