Plot function return a message

I newly installed Julia 1.6. The plot function in StatsPlots or Plots packages return this message (the function worked perfectly in Julia 1.5.3) connect No error GKS can't connect to GKS socket application

GKS Open failed in routine OPEN_WS
GKS GKS not in proper state. GKS must be either in the state WSOP or WSAC in routine ACTIVATE_WS
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine FILLAREA
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine TEXT
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYLINE
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS: GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER
GKS GKS not in proper state. GKS must be either in the state WSAC or SGOP in routine POLYMARKER

I do not understand the meaning of this message and what I can do

Thanks for any contribution

Please consider the environment before printing.

please what do you mean by consider the environment?

There is a long issue with similar error messages:
https://github.com/JuliaPlots/Plots.jl/issues/1649
Perhaps you find a “solution” there.