Hot answers tagged

17

Here is a really simple example library(raster) data(volcano) volcanoR <- raster(volcano) #making colors below 100 red and above 180 blue in this example breakpoints <- c(94,100,120,140,160,180,195) colors <- c("red","white","white","white","white","blue") plot(volcanoR,breaks=breakpoints,col=colors) You just need to pass the plot a vector of ...


16

You could listen for the "overlayadd" and/or the "overlayremove" events on the map object and have two separate legends (two controls) defined, e.g.: map.on('overlayadd', function (eventLayer) { // Switch to the Population legend... if (eventLayer.name === 'Population') { this.removeControl(populationChangeLegend); populationLegend....


16

In 10.1 you have a lot more control over legends. You should be able to wrap both the labels and the description using the Text Wrapping option in the Layout tab (see below) If that still doesn't work you can manually force the line breaks using the Symbology tab in the Layer Properties. If you right click each of your unique values and select Edit ...


16

Here you find the map including the legend. The legend is in German, but I am German, so I tried to translate it as precise as possible. I think (and please @Giancarlo correct me, if you disagree): 1 is "Reichsstra├če, ausgebaut". That means a well-developed street. 2 is propably a sort of drainage system or stream (thank you @AndreJ). It is not named in ...


14

I have managed this earlier by following this workflow: Double-click the Legend in the Layout. Legend Properties > Items tab. Select the layer in the list and click the Style button. Click the Properties button. Go to the General tab and click Label Symbol. Click the Edit Symbol button. Then use the X and Y offset values to move the labels to the left - ...


12

To start with I will drop this website as a resource you should tie into. your sequences are actually backward. your fourth has to be the first thing you attempt. (something I learned long ago is to plan what you want to end up with and then work back to where you are so you are sure you will end up with what you want [not something else]). 1. you need ...


12

In layout view, open the legend properties and browse to the Items tab (see above picture) where you can specify which items show the count. If you were asking specifically about showing the count in the Table of Contents, I'm not sure how this can be done. I looked around but only found this helpfile from ArcMAP that states For example, you can use ...


11

It's a great question. One standard set of iconic markers with which everyone in the world is familiar is their country's set of street signs: stop, yield, crossing ahead, etc. I hope the point of such standardization is immediately obvious. Note that the actual meanings of many of the highway symbols are not intrinsic: they must be learned (especially ...


11

Decrease the height of the the legend box to zero: In the example below you can see that I got a line legend even if my data is polygon. Right-click on your legend, click on properties Go to the Legend tab and change the height into either 1 or 0. That will reduce all polygon layer patches in the legend to lines. You can also set this property per-layer, ...


10

I guess the idea is that you don't have to make anything up and if your "boss" askes why something looks the way it does, you can just point him to "the standard".


10

The method we use is to have a duplicate copy of the layer just for the legend. After the map layer looks the way you want, just drag the layer from the TOC and on to the map to make a duplicate. We append '_map' to the name of the map layer version to differentiate between the two layers. Then the symbology size or width can be adjusted for each icon or ...


9

I had the same problem last year : a few dozen of maps to produce within three days, same legend, but different locations. I used this setup : vector data in PostGIS raster data in GeoTiff (shaded relief) cartographic engine : MapServer, with PDF vector output batch processing : PHP to automate MapServer, with MapScript PHP finalization with Adobe ...


9

In ArcMap 9 and 10 you can go to Insert > Legend in layout view, and follow the GUI to create & format the legend.


9

Another option is to add a rectangle shape to the composition, then style the rectangle using a gradient fill with the same color ramp as your raster. This can be done directly in QGIS, no image editing or html required.


9

The workaround I usually use for any situation in which I want to customize the legend entry for a layer is to create a dummy layer which is only used in the legend, and not displayed on the map. So in your case, create a new line layer using a line shapefile with no features in it, symbolize it however you want, and add that to your legend. The new layer ...


7

Legend Limiter The Legend Limiter only works on layers that use "unique value categories" to define symbology. This style of legend can be set up in the Symbology tab of the Layer Properties dialog. Legend Limiter will not limit the symbology of layers set up with single symbol symbology. http://arcscripts.esri.com/details.asp?dbid=16097


7

On the third screen of the legend wizard you have the option to assign the gap that you want between the frame and the object in the legend (this also applied to neatlines). Adjust that until it looks right. I too also convert features to graphics, but this is the very last thing I do on a map; it is no longer tied to the map features and if you change ...


7

Rather than try to use the ArcMap application alone, I have brought ArcPy into the picture. I just tested and achieved what you described using the UniqueValuesSymbology (arcpy.mapping) class which has a writable classDescriptions property which can be set to: A list of strings or numbers that represent the descriptions for each unique value that can ...


7

To complement Luigi's answer, this is how you can use the Layer Tree View for adding a legend and/or a ToC to your application. After you create your canvas in your standalone PyQGIS application, you need to create a QgsLayerTreeView. For that, you need a model, and for the model you need the layer tree root. Additionally, you need to use a ...


7

In QGIS 2.8 Composer, there's a Wrap text on option in the Item properties tab when you add a legend which lets you enter a character where you want the new line to start. What I normally do is use the * character in the layer's name for where I want the new line. Then input the * into the Wrap text option. (I'm using QGIS 2.8.2-Wien): Hope this helps!...


6

There is no need to write any additional ArcPy for this. Simply use dynamic legends (which were added at ArcGIS 10.1) when you are authoring your maps. The Map Extent Options allow you to control how eligible legend items interact with the current map extent. If the Only show classes that are visible in the current map extent check box is checked, a ...


6

If you have access to ArcMap, examine the arcpy mapping module: Arcpy.mapping is a Python scripting module that is part of the ArcPy site package. It gets installed with ArcGIS for Desktop and is available to all licenses. It was designed primarily to manipulate the contents of existing map documents (.mxd) and layer files (.lyr). and also Data ...


6

Could you use Descriptions? They can handle multiple lines in the legend.


6

not sure if the users are IOS or Android but maybe the list/interface icon it would go nicely with what the user is used to seeing in other apps, unless of course its already being used for something else.


6

You can use CSS border-radius to create circles. For example, put this in your stylesheet/style tag: .legend .circle { border-radius: 50%; width: 10px; height: 10px; margin-top: 8px; } Then add the circle class to the color block when you create the marker: div.innerHTML += '<i class="circle" style="background:' + getColor(...


6

Yes it is, but there's a bit of work to it. The article in the previous answer related to text description fields which can be edited and entered manually for each symbol class: These are automatically italic and their font can be changed without affecting the layer name or symbol classes. If you want to italicize only one word in a symbol class you can ...


6

Uncheck the "auto update" box. This makes it possible to remove fields from the Print Composer without removing them from the project. You can't remove a parent without removing the children. However, you can click the Edit Text (pencil) icon, erase all the text, and the legend will eliminate the whitespace.


6

Assuming that you mean the visibility of the layer in the Table Of Contents, once you get a reference to the layer, it has a visible attribute: import arcpy inMXD = "xyz.mxd" lyrName = "layername" mxd = arcpy.mapping.MapDocument(inMXD) df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] #the first data frame lyr = arcpy.mapping.ListLayers(mxd, lyrName, df)...


6

German surveyors did everything according to rules. For the 1:100.000 Karte des deutschen Reiches, you can find it here: http://www.landkartenarchiv.de/deutschland_topographischekarte_1896_legende.php and http://www.davidrumsey.com/luna/servlet/detail/RUMSEY~8~1~215008~5501917:Legend-for-Karte-des-Deutschen-Reic #1 are major roads, no need for trees. ...


6

In the QGIS map composer, under Legend Items, you can specify the number of columns that you want in your legend e.g.: Which will produce:



Only top voted, non community-wiki answers of a minimum length are eligible