Trajectory of homogeneous poisson process I am trying to simulate number of claims in next 12 months using a homogeneous poisson process following the R codes:
lambda <- 17
# the length of time horizon for the simulation T_length <- 31
last_arrival <- 0
arrival_time <- c()
inter_arrival <- rexp(1, rate = lambda)
while (inter_arrival + last_arrival < T_length) { 
last_arrival <- inter_arrival + last_arrival 
arrival_time <- c(arrival_time,last_arrival) 
inter_arrival <- rexp(1, rate = lambda)
 }

And I get a list with around 500 elements, then I repeat this for each of the twelve months, how do I plot the trajectory of the counting process?
 A: The following code plots a line chart with the appropriate jumps.
n <- length(arrival_time)
counts <- 1:n

plot(arrival_time, counts, pch=16, ylim=c(0, n))
points(arrival_time, c(0, counts[-n]))
segments(
  x0 = c(0, arrival_time[-n]),
  y0 = c(0, counts[-n]),
  x1 = arrival_time,
  y1 = c(0, counts[-n])
)

Output:

A: The code below plots the counting process $\{N(t),t \ge 0\}$ with rate $\lambda(t)$ taken from this example. It plots three arbitrary sample paths {5, 10, 15} from the 2000 generated. 
It will work for a stationary Poisson Process (PP) with fixed rate $\lambda$ as well.
MATLAB code:
% MATLAB R2018b
% Plots paths p1, p2, p3
p1 = 5; p2 = 10;, p3 = 15;

figure, hold on, box on
s(1) = stairs([0 EventTimes{p1,:}],0:length([EventTimes{p1,:}]),'b-')
s(2) = stairs([0 EventTimes{p2,:}],0:length([EventTimes{p2,:}]),'r-')
s(3) = stairs([0 EventTimes{p3,:}],0:length([EventTimes{p3,:}]),'k-')
plot([EventTimes{p1,:}],zeros(1,length([EventTimes{p1,:}])),'bx')
plot([EventTimes{p2,:}],zeros(1,length([EventTimes{p2,:}])),'rx')    

% Cosmetics
title('3 x Sample Paths for NHPP')
xlabel('Time')
ylabel('N(t): Number of events by time t')
set(s,'LineWidth',1.5)

Sample paths plotted below with event times shown (on horizontal axis) for two of them (red & blue). 


Update:  Based on OP comment,
For a fixed $t$, $N(t)\sim\text{Poisson}(m(t))$ where $m(t) = \int_0^t \lambda(s)ds$.
So based on the OP's comment regarding $N(365)$, $N(365)$ is distributed Poisson with mean $m(365) = \int_0^{365} \lambda(s)ds$.
