Questions tagged [plot]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
19 views

`tmap` basemap in `plot` mode

I have a raster and I'd like to underlie it with a basemap in tmap. In the view-mode this kind of happens automatically. But when I set it to plot-mode I really struggle to get a basemap. Anyone maybe ...
0
votes
0answers
37 views

Plot different layers from RasterStack object in R

Is there any way to automatically plot each layer from a RasterStack in R. I'm a little bit lost in the vast amount of options. There is tmap, mapview and also leaflet... For example if you have a ...
2
votes
1answer
76 views

Styling plot items by category in QGIS print layout

I am making a sensitivity atlas which gives me gridded sensitivity values (A to E) for a given area. I am using the atlas functionality in QGIS 3.10 to create several maps showing these sensitivity ...
2
votes
0answers
26 views

Change the colors of the pie chart in compouse (plot) in QGIS 3.10

When using the new plot command available in QGIS 3.10 for compouse pie chart generation, I didn't find any option to change colors. Is there any way to choose colors?
2
votes
1answer
56 views

How to highlight/shade areas of raster based on specific values, in R

I have a raster with values ranging from 1 to 5 like the following: library(raster) library(rasterVis) library(viridis) my_class <- raster(x=matrix(sample(x = 1:5, size = 12, replace=TRUE),4,3), ...
2
votes
2answers
41 views

QGIS 3.6 - Deleted Polygons

I'm putting together a large map consisting of some big datasets, and unfortunately deleted some (around 25) polygons from a key layer when editing a smaller version of the map for a different request....
2
votes
1answer
38 views

Automatic method for placing values of determined column from a SpatialLinesDataFrame near contour lines

I have following vector layer that represents countour lines. With QGIS 3, labels placed near lines (Layer Properties -> Labels) were taken from TEMP_ENE field in attributes table. I would like a ...
2
votes
1answer
88 views

Plotting density map of points?

I have some points and I would like to plot the density map of them. I have tried like this: plt.figure() xedges = np.linspace(540000, 550000, 20) yedges = np.linspace(5200000, 5500000, 20) H, ...
3
votes
1answer
242 views

Counting number of points in each grid?

I would like to count the number of points in each cell. I have tried https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram2d.html but the out isn't appropriate. Does anybody know how I ...
2
votes
0answers
137 views

Change size to the squares of the confusion matrix [closed]

I have a problem with size in the 'plot_confusion_matrix', the squares of the confusion matrix appear cut off. I would like to solve this problem. svc = SVC(kernel='linear',C=1,probability=True) svc....
2
votes
0answers
103 views

How to change the color of an specific area of a shapefile using Python?

I have this map and I need to emphasize with a different color some cities from this map: This is my code: import matplotlib.pyplot as plt import json import time import geopandas as gpd from ...
0
votes
0answers
31 views

ArcGIS Python API Plotting ValueError: setting an array element with a sequence

Got a pandas spatial df using ArcGIS python API. The data is read in via pd.DataFrame.spatial.from_featureclass()–i.e., a shapefile. Once loaded, df has a SHAPE column, as you see here. Next, ...
0
votes
1answer
689 views

Adding legend title in plot function of R

I use plot function to plot a raster in R. The plot function adds a legend as default. However, the default legend added does not have a title. For instance I need to add the unit such as meters. I ...
0
votes
1answer
167 views

Making raster histogram excluding zeros in R?

In R, can I make a histogram of all the non-zero values in my raster? Some reproducible data below. I just want the histogram to be made with the zeros. Happy with a way to do that, or I guess to ...
0
votes
1answer
32 views

Unable to plot in R some locations over a shapefile

I have a shapefile of polygons that I got from here, and a CSV file with longitude, latitude data (i.e. lon= -71.4; lat=42.5). The shapefile has the following CRS information: "+proj=lcc +lat_1=41....
1
vote
0answers
36 views

Plotting with QGIS, blank positions result in errors

I tried to use the delimited text layers, then I found something wrong. Several plots are out of bound. Then I checked the original data and decoded data. It seems when one part of a single data is ...
1
vote
1answer
214 views

Creating PNG images using QGIS 3 pygis

Some days ago I upgraded from QGIS 2.18 to 3.6.0 - not knowing that many Python scripts won't run without modifications. I could convert all of them but not this one: from PyQt4.QtCore import * from ...
1
vote
1answer
41 views

QGIS transparent layers plot as solid opaque - solution? [closed]

I have been trying to plot from QGIS to a HP Designjet T120 plotter using Win10x64, but the transparent layers of my QGIS project appear as solid opaque on the plot. If I plot to PDF to transparent ...
3
votes
1answer
62 views

How might one optimise geospatial operations on complex polygons, especially plots in R?

Question: I'm attempting to run some simple plots on some shapefiles with a high number of complex polygons. These aren't massive files - for the example below, the shapefile is 70mb (15872 obs), but ...
1
vote
1answer
2k views

How to use st_buffer?

I would like to calculate a buffer of 5km around country polygons. However, I somehow always get a warning and an error. Here is a reproducible example code. library(sp) library(sf) library(tmap) ...
2
votes
1answer
153 views

Expand plotting area of raster::plot

I have a raster that I'd like to plot in the Azimuthal Equidistant projection with a grid and labels. So far I've been able to do that. However, I cannot get the labels inside the plotting area. ...
1
vote
0answers
117 views

Multipanel with raster (spplot) and scatter plot in R

I have one raster and one scatter plot that I want to put together in a single multipanel plot. However, the par(mfrow=c()) that usually works to put together different normal plots, it doesn't work ...
0
votes
1answer
134 views

Extract a list areas and indices of multi-part polygons (SpatialPolygonsDataframe) R

I'd like to extract a list of polygons from a SpatialPolygonsDataFrame that include more than one area (so a polygon with a hole for example, or just 2 areas in one polygon entry in general). There ...
0
votes
1answer
80 views

Plot a series of subsetted pixels from a raster stack in R

I have created two raster stacks and would like to plot a row or column of pixels through the stack, but am not sure how to approach this. I know I can subset by layer, but how do I subset ...
0
votes
1answer
351 views

Legend Key for discrete values in spplot

I have a shapefile with various attributes. I want to plot the shapefile using `spplot'. I first read the shapefile A <- readOGR('myshapefile.shp') I am using the following command: p <- ...
0
votes
1answer
479 views

Adding labels to raster with levelplot and spplot

I am trying to add district labels for a country, which I am plotting using levelplot (to use worldclim precipitation data) and adding boundaries using spplot. I am having trouble adding text labels ...
4
votes
1answer
3k views

How can I superimpose a geopandas dataframe on a raster plot?

I have a geopandas dataframe countries with country polygons, and a raster dataset raster (read with rasterio). I've already aligned the two as follows: countries = countries.to_crs(raster.crs.data) ...
2
votes
2answers
2k views

Remove internal boundaries in spatial object/polygon for plotting

I am trying to plot a spatial object where only the outer boundaries/borders are plotted. The only way I can think to do this is by manually removing all the lines/points within the spatial object and ...
2
votes
1answer
140 views

How to display multiple plots in R Scripts running in QGIS

While plotting in R in QGIS, only the latest plot appears in 'Result viewer'. What do I do to get all the plots done during script running? Here's the code: ##showplots bin_arr <- c("C:/Users/...
1
vote
0answers
215 views

Show charts and plots in plugin

I'm creating a plugin to guide a user though a GIS analysis process. One of the things the user wants is the ability to display "charts" of the resulting data sets. I'm looking to build simple ...
1
vote
0answers
226 views

Invert the legend scale representation [in R environment]

Through the following code, cols <- (heat.colors(255)) plot(raster_sum3, col=cols[round(seq(1,255,length.out=10))], legend=TRUE) # raster of the study area plot(site_3003, add=TRUE) # site ...
0
votes
0answers
348 views

QGIS: How to plot a GPS track color-coded by the altitude (or any other value like speed, …)?

I have GPX files recorded from various treks. I want to plot them on a QGIS map and have the color of each track segment modified by the altitude recorded. An idea of the result I am looking for is ...
2
votes
2answers
139 views

Hacking QGIS plugin Midvatten to allow capacity explanation label on stratigraphy plot?

I have been trying to make a local addition to the python code for QGIS plugin Midvatten to allow labels on the stratigraphy plot that give the capacity explanation rather than the capacity value. In ...
1
vote
2answers
3k views

Categorical Legend raster plot - R

I have the following RasterLayer containing categorical values for each pixel. I am using the following code to plot it par(xpd)=FALSE plot(LC, legend=FALSE, col=c("lightcyan3","royalblue","...
2
votes
1answer
196 views

QGIS Midvatten stratigraphy plot issues

When I use the stratigraphy plot function in Midvatten on an East Anglian coast quaternary data set (West 1980) that I have been digitizing, I find that the upper layers of strata disappear at the top ...
1
vote
1answer
3k views

R tmap package: basemap not working

I want to use the package tmap to plot a simple shape with a basemap (e.g. OpenStreetMap). According to the help page of tmap this should be able by using tm_layout(basemaps = c('OpenStreetMaps')) ...
4
votes
1answer
531 views

How can I create a multi-dimensional spectral plot using R?

I have a raster stack of several layers such as NDVI, Slope, texture, and TCT bands, and would like to create a multi-dimensional spectral signature plot from my ground thruth points representing ...
3
votes
1answer
3k views

Change Color in GeoPandas Plot

My question has overlap with Changing colours in GeoPandas?, but unfortunately still unanswered: I want to plot a multiline shapefile in 1 color. import geopandas as gpd multiline_example = gpd....
2
votes
1answer
1k views

Plot two rasters with different extents

I have two rasters with different extents that overlap partly: ext1 <- extent(99500,700500,249500,600500) ext2 <- extent(1356,643990,269903,690810) #create rasters rr1 <- raster(matrix(...
3
votes
1answer
1k views

Converting Northings/Eastings to Longitude/Latitude using R issue with Northern Ireland?

I have found a lot of questions about conversions of Northings/Eastings to Longitude/Latitude in R. I have been working with this tutorial from Alex Singleton which is really useful in explaining the ...
1
vote
1answer
540 views

Logarithmic raster with a non-logaritmic legend in R

Following the example under: library(sp) library(automap) loadMeuse() demo(meuse) # Ordinary kriging kr = autoKrige(log(zinc)~1, meuse, meuse.grid) spplot(kr$krige_output,'var1.pred') I get a plot ...
2
votes
1answer
6k views

R plot raster: changing breaks also changes colour scale

I am trying to change the breaks of a raster in R that is show with a continuous scale. However, changing just the breaks also changes the colour scale. I am not sure how I can fix this? library(...
1
vote
1answer
267 views

R: plotting 2 polygon shapefiles, problems with CRS & extent

I am trying to create a map using 2 shapefiles, both of which have been subset. I am plotting municipalities of a census district in Canada. For the census district, I am using the [census division ...
2
votes
2answers
1k views

Plot raster using raster attribute in R

I would like to plot a raster in WGS84 projection using R based on its attribute value. Here is the whole procedure library(maptools) library(rgdal) library(raster) shp <- readOGR("...
1
vote
1answer
220 views

Plotting map in R that looks old (yellowish and stained)?

I want to make a map in R that appear old (yellowish and stained). For example: Is it possible to achieve this effect entirely within R rather than bringing a map into an image processing program ...
2
votes
3answers
2k views

Adding a legend to points in the tmap package

I am trying to create a map with several points (about 20), where each point will be represented by a number, and where a legend will have these numbers and names of my points. Is it possible to do ...
5
votes
1answer
1k views

Slow plotting of spatial data in macOS RStudio's plotting device

In my macOS system RStudio, plotting spatial data (statialpolygons, points and lines) is extremely slow, making it impossible to work with. When I try to plot the shapefile in this link (@https://...
0
votes
1answer
458 views

r- Compress/ Speed up large Spatialpolygonsdatafram

I am brand new to R and GIS and I ultimately am not doing anything to complicated (for now) but have been struggling with even the most basic task! I'm simply trying to plot a map of the US states. I ...
1
vote
1answer
196 views

Slow plotting SpatialPolygonDataFrames on some systems

I have noticed that my personal computer is very very slow plotting SpatialPolygonDataFrames. I made a question about this issue on the general Stack Overflow, and with the answer I got I ended up ...
1
vote
1answer
2k views

Ploting Multipoint with Geopandas

I created one geodataframe with geopandas. The geometry field was filled with Multipoint. However, when I try to plot the map to see multipoints, my map returned empty. How can I plot geometry field (...