Interesting to know there is a limit in terms of the thinnest possible line. My dots are very dense, it looks like I won’t be able to plot a proper dotted line. It will look like a regular line instead.
I tried to weaken the line by making it half transparent and it is not working well either. Are there any other approaches I could use?
I’m plotting the global EEZ lines. I just tried to pick up one lon lat pair out of every 10 pairs. Unfortunately, the plot is kind of messed up. Data points are connected with data points that should not be connected across the global map.
My data are two-column containing longitude and latitude. They are composed of over 300 segments separated with NaNs. When we pick 1 data point out of every 10, sometimes the NaNs are removed causing problems. I can certainly write a loop to fix that, but the issue of this kind of data is that their data density is not consistent. In less dense areas, picking up 1 out of 10 will significantly alter the shape of the geographic area.
Well, I mention the decimation because you said you had many points.
EEZ polygons should not have many points. What for?. I can plot a dotted map quite quickly with an old EEZ file I found in my computer with
Many thanks! It’s wonderful to know that this can be done this way!
I did not know that we could directly plot info out of a shp file. I had to extract the lon lat out of the shp file myself. Maybe that was the problem.
So the best way to plot the shp polygons are using imshow? I got the below error:
LoadError: UndefVarError: imshow! not defined
Stacktrace:
[1] top-level scope
Here is my code:
EEZ = gmtread("/Volumes/Path1/EEZ_Land.shp");
imshow!(EEZ, ls=".", fmt=:jpg, dpi=600, show=false, savefig=File_w);
You get that error because imshow! does not exist. imshow is a convenience function to show the result by default (normally one-liners commands). The ! Julia convention is to append to an existing image but you have none to append to. In the more rare occasions where we don’t want to display the image, we use the show=false option.
Hmm, I was also expecting this to work pen=(width=5, color=:red, style=".") but it’s not. I’ll have to go see the docs if that is promised. But use this form pen=(0.1, :red, ".") to specify the pen.
A trick when we have surprises is to use the option Vd=1 and see the generated GMT command to spot any obvious errors.