Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. Result of "echo df":
  2.  
  3. Dataframe with 2 columns and 28 rows:
  4. Idx spikes neurons
  5. dtype: int int
  6. 0 0 0
  7. 1 502 0
  8. 2 502 0
  9. 3 502 0
  10. 4 502 0
  11. 5 502 0
  12. 6 502 0
  13. 7 502 0
  14. 8 502 0
  15. 9 502 0
  16. 10 502 0
  17. 11 502 0
  18. 12 502 0
  19. 13 502 0
  20. 14 502 0
  21. 15 502 0
  22. 16 502 0
  23. 17 502 0
  24. 18 502 0
  25. 19 502 0
  26.  
  27. Code:
  28.  
  29. ggplot(df, aes("spikes", "neurons")) +
  30. geom_linerange(aes(ymin = f{1.0},
  31. ymax = f{-1.0})) +
  32. scale_y_continuous() + # make sure y is considered cont.
  33. ylim(1, -1) + # at the moment ymin, ymax are not considered for the plot range (that's a bug)
  34. ggtitle("Spike raster plot") +
  35. ggsave("spike_raster.pdf")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement