0

I am using the plot widget to include a profile in my Qgis print composer map atlas output.

It refers to a layer with distance along (a straight) line and depth attributes as well as the geographic coordinates.

When I select scatter plot with lines to join the dots (there is no simple line plot option), while the line is generally plotted in the expected sequence from 0 - 0.5km etc, occasionally it skites backwards and forwards across the plot.

I have three attributes in the table: fid - integer64 - going 0 to 12000 in linear fashion; distance - real - going up linearly slightly more than a meter at a time; and depth - real - undulating like you might expect on a generally quite flat surface.

The table is currently ordered by fid, but any way other than depth - fid, distance, easting, northing, latitute, etc - would all create a linear point by point increment.

I cannot see what reason is making it jump about or any other way to sort it.

Anybody got any ideas what I can do?

I could use another app to make the plots and reference them as images, but it would be far better if this just worked as expected. It is one of these things that colleagues will ask for a thousand miniture changes. I have used the widget a few times before and never notices it happen.

Scatter plot jumping around x axis

Edit: It only happens when I use the Altas functionality to 'only show features visible in the map'.

If I plot the whole route from start to end it is ok.

It is when the atlas is set to only show (a buffer around) say 2.5 - 3.0 km, not the whole 0 - 12.7 km, that I get the horrible skiting around, when extracting just the points from the layer that are in the 2.5-3 range.

1 Answer 1

0

Not really an answer - but here's my workaround....

Since plotting the whole profile worked, but 'Only show features in Map' didn't, I got around it by plotting the whole thing, but then working out my own x, y limits.

It needed me to add another 'Sheet' attribute to my profile layer and then calculate which sheet each point on the profile would be on, then set the limits by min, max expressions such as:

aggregate(layer:='RouteProfile',aggregate:='min',expression:="Distance",filter:="Sheet"=@atlas_featurenumber)-0.01

Not so happy with the extra faff, it seems either a bug in the widget or it needs a 'sort points by' field selector added, but it lets me move on.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.