How can I draw points and line which are not visible (they are hidden from certain point of view) - actually they are visible due to alpha, with different markers and line styles.
I can set all of the markers and lines, but I need them different in the background.
Related
Here is my Current View
I'm wanting to add a legend to distinguish between members(yellow line) and casual riders (blue line) so viewers can see which line is which.
Seems like this should be simple, but I feel like I've tried everything. The closest I've come is by getting a legend to pop up by dragging measure values over to the color, but then it changes my colors that I have already established and syncs both lines as the same color or gradient of colors. All I need is a legend detailing which line is which.
Instead of individually changing each line's color, place Measure Names in the Color shelf of All marks card. This should make the legend appear on the right.
I am loading a bunch of geojson points. I can see that I am loading about 40 points but which ones get displayed on my map seems random and somehow connected to the zoom level. Below you can see that only 2 points of ~40 are displayed.
What criteria does mapbox-gl-js use to decide what to display?
Is there a way to control what points are being displayed? (All of them? Some based on an attribute?)
This is likely occurring because you are using the default text-allow-overlap value of false. The text-allow-overlap documentation reads
If true, the text will be visible even if it collides with other previously drawn symbols.
Because your symbols overlap each other, some are hidden. You can disable this behavior by setting text-allow-overlap to true.
You might find marker clustering to be useful.
Since version R2014b, MATLAB now renders graphics nicely anti-aliased (finally!)
However, this causes a glitch in the way it displays some of my figures. If I plot a line, use hold on and then plot another line in exactly the same place with a different colour, the line appears in a mottled combination of both colours. In the past, the line would simply appear as the last colour that was plotted in that location.
Here's an example of a trace in blue, with some sections (the steeper bits) showing a green line. In previous MATLAB versions, the green lines would be continuous, but now some of the blue line shows through.
Is there a neat way to work around this in the new version, or do I have to ensure that I remove any existing lines before plotting in the same place?
When overplotting, the new anti aliasing plots can have some bleed through, try
set(gcf,'GraphicsSmoothing','off')
To see if it restores the functionality you're used to.
Ref:
http://www.mathworks.com/matlabcentral/answers/157758-how-do-i-turn-off-antialiasing-in-matlab-r2014b
How can I deal with overlapping lines in the Leaflet map library?
I download geoJSON from the server sid and draw it right onto the map. If there are two identical entries, Leaflet draws them twice. This could be fixed by finding exact duplicated on the server side.
That however doesn't work for different datasets sharing some of the same space. As a result parts of both are drawn onto the same spot.
It appears that the lines are being rendered with the default Leaflet Polyline opacity of 0.5. If you were instantiating the Polylines yourself in code, you could override the opacity to make the lines opaque in this manner:
var myPolyLine = new L.Polyline( myPoints, { opacity: 1 } );
The line that would appear on top would then be the line that you added to the map last (one or the other is going to be on top, unless you make them both opaque and the same color). But this may be moot if you are loading in geoJSON directly and don't have control over how Leaflet renders it.
A figure file is saved. When several lines are intersected, I want to make one of the line visible. How should I modify the different layer of the lines without re-plotting the figure?
Use uistack (see doc). For example, after:
figure
hold on
hblue=plot([1 2],[3 4],'b','LineWidth',5);
hred=plot([1 2],[4 3],'r','LineWidth',5);
the red line is on top (and the blue line would not be seen if the the red line covered it). Then, if you use uistack(hblue,'top'), the blue line is brought to the top. Other options to reorder plots, instead of top, are up, down, and bottom. You can optionally specify the number of steps up or down (e.g. uistack(h,'up',2) to move a handle two layers up - though no need in my simple example).
If, as you say, the 'figure file is saved', and you don't have the handles for the plots, (hblue and hred in my example), after loading the plot, you can get the handles using get(gca,'children').
If I understood you correctly, try to use hold on before plotting...