Closed IssamHu closed 3 years ago
What do you mean by "it dosen't work"? What do you want to achieve?
Please, provide more details and reproducible code. You should help me help you, by providing all the code necessary to reproduce your problem (including the creation of the Piedata
dataframe: I should not have to manually copy-paste in a text editor the raw data you provided, then edit it to remove the line numbers, save it and import the data manually in R just to be able to reproduce your problem/graph/example). Next time, please provide a fully reproducible example
You downloaded bathymetric data over a region with a fixed bounding box (from 48º to 60º in longitude and from 15º to 31º in latitude). By setting xlim = c(40,70)
you try to set boundaries that go beyond the bathymetric data you downloaded, so you can't expect to get bathymetric information there. This is a perfectly normal behaviour.
If your objective is to restrict the white space on both sides of your plotting region, just resize your plotting window (or, preferably, set the size of your graphic device explicitly (for example with png(width = ..., height = ...)
. You have to understand that you are plotting geographic data. Hence, by default, marmap
uses a fixed aspect ratio (asp = 1
) to plot bathymetric data, in order to ensure that one degree in longitude is always of the same length than one degree of latitude. If this doesn't suits you, just use asp = NA
. Your bathymetric data will then completely fill your graphic device with no white space one the sides, but depending of the aspect ratio of your graphic device, your map will be (sometimes very) distorted.
In any case, this is all normal behaviour, there is no bug here, and a quick look at the argument list of ?plot.bathy
and/or the package vignettes should point you in the right direction.
Hi Sir, When I plot with space.pies the plot is not working with xlim:
The data used: Piedata Country Legal Illegal Latitude Longitude cola colb 1 A 0.375 0.625 29.74247 48.41323 lightblue orange 2 B 0.852 0.148 27.77500 49.14698 lightblue orange 3 C 0.345 0.655 26.31520 50.49300 lightblue orange 4 D 0.562 0.439 25.56074 51.64831 lightblue orange 5 E 0.410 0.590 25.45679 54.72089 lightblue orange 6 F 0.750 0.250 21.11154 59.32937 lightblue orange