-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change axis limits #838
Comments
Yep, sounds useful. 😄 |
The rectangle selection is no longer possible. Control+click can be used for selecting a range of items. This allows more freedom for performing customisations as requested in issue "Change axis limits #838". The "Load all data" button tool-tip and icon have been readjusted so they hint the additional use pattern of resetting the plot to the original zoom and range limits. New and more appropriate icon for the "Save Plot" button. Icon from the Silk set from famfamfam.com.
@struck89 I've enabled some user interactions in the plot that might allow you to adjust the plot to your needs. Letting the user set explicitly the axis limits would also make sense, but this was actually easy to implement and, in my opinion, improves the situation a lot. If you are still using the application, could you try it in the next nightly build and give some feedback? |
@struck89 ping? 😄 |
Hi! |
Thanks @struck89. 😄 |
Hey, the drag and drop, and the zooming are great. Sadly I have to say I managed to break the thing at my first attempt. Problem? When executing an statement like: I uploaded a video. The link will expire soon: Another observation, the number of elements plotted are limited to 50.000. If the number of results coming from the query is greater, and not everything is plotted (for performance reasons I assume), I think you should say it. "WARNING, too many rows, only plotting first 50K" or something. This is very important!! otherwise there is missing data in the plot! Best regards, EDIT: I can answer my "aspect ratio" question. I saw the answer in: EDIT2: Another problem, sometimes I don't get the results to be plotted. I can't see a trend of what is causing it. Sometimes it depended on increasing or not the limit of results, sometimes on using or not the keyword sort by. |
I think you're seeing the same crash as described in #1262. The limit of 50K rows that you are seeing is the prefetch block size that you can set in the Preferences. There is also a button in the Plot Dock for loading all the data. I agree that some kind of feedback should be given, or assume that the prefecht works well for browsing, but not for plotting, and consequently try to plot everything... I don't know. Maybe @MKleusberg can help with that. |
Great, thanks! |
Yeah, some kind of visual warning thing - but not like a popup the user needs to interact with - to remind or alert the user that not all of the data available in the table is being plotted. I get a feeling though this could be tricky. On the other hand, it would only be needed for the situation where the data-loading-chunk-limit thing is being used yeah? The other plot situations, such as plotting the results from a query or similar wouldn't have that limit. Anyone have ideas? 😄 |
What if we enable the "Load all data and redraw plot" button only when there is data not loaded yet due to the prefetch mechanism, or when the user has zoomed or dragged the plot? In the first case we could also set a red background to the button and set a warning in the button tooltip, so it is more visible and self-explanatory. |
That sounds like a decent idea. 😄 What do you reckon @struck89? |
Warn user if not all data has been fetched and hint about the button for loading all the data. The attention to this button is attracted changing its background to a reddish colour and showing a warning in its tool-tip, which is automatically shown for its default duration. Default message is simplified and the button is only enabled when it is useful (users of non-big databases would never be distracted about the fetching mechanism). Since this button is also useful for resetting the zoom and axis range, it is also enabled if the user performs one of these interactions over the plot. See discussion at issue #838.
@struck89 I've implemented the visual warning so you can see it in action and give some feedback. |
Hi @mgrojo, Thanks for your efforts! EDIT, about the zooming: Also, is there any way to get the row/rowid of a selected dot? |
Hi @struck89, Thanks for reporting the crash, I had tested only with a project with settings saved for the table. With That issue with the zoom is very strange. Does it happen also when one of the axis is selected? It is probably a precision calculation error in qcustomplot. For getting the rowid of a selected dot, right-click first on the table header and click on "Show rowid column". |
Good morning to everybody and happy friday! Once clicked it gets grayed out and back to normality. (but when we zoom: https://we.tl/ss2taw7Lqs) (maybe this is expected behaviour, to fix axis limits) About the sparkling dots, it does still happen with one axis selected. (I just discovered, not only the zoom gets restricted to the axis but also the drag and drop. Love it!) And about the rowid for a dot, I right-clicked everywhere (both table header in the plot or in the results, and everywhere else) and I can't see the "show rowid column". The only menu I get is "Copy" on the graph. Thanks! |
Avoid inheriting the style sheet in child widgets by naming the widget type where it is set. This had the effect, reported in issue #838, of setting an unwanted style in child widgets, like the tool-tip of the "Load all data" button, the tool-tip of the SQL results pane or the context menu of the search-bar edit line.
Let's see if this fixes the problem about disappearing points while zooming reported at issue #838.
Hi @struck89. The issue with the tool-tip should be fixed with the last commit. I've updated the plot library to version 2.0.0 from 2.0.0-beta. Let's see if this fixes the problem about disappearing points while zooming. Otherwise, I don't though how to solve it, sorry. The "show rowid column" option is in the context menu of the table in Data Browser tab. If you are trying with query results, it will not work. In that case you should be able to add the rowid to your query. Does this helps? |
@struck89 I forgot to mention that the behaviour of the button after zooming is intended. It's the way to reset the plot to the initial zoom and axis ranges. Otherwise a different button would be needed. I don't think it is worthy of the space it would need. |
Hey @mgrojo! But regarding this:
I managed to find what you mentioned, and I found out it automatically selects (theoretically) the row of the dot. To sum up again, plotting does not respect the order of the results, it rearranges the results, again, by the x value. So if the x value is not ordered, this results in a completely undesired effect, the selected row has nothing to do with the actual selected dot: EDIT, following issue #821, at the end, @MKleusberg refers to Qcustomplot documentation, so this means this is not something straightforward.
Source: http://www.qcustomplot.com/documentation/classQCPGraph.html#details QCPCurve: I did not expect this to be such a major design restriction. But given the previous quoted text, I don't understand why I can have multiple Ys per X (vertical lines) And last thought: The missing points might be because of AdaptiveSampling in QCP |
Oh, that is very unfortunate. Ideally the problem of the reordering should be fixed with QCPCurve and then the selection problem would be easy to solved, but as you have already pointed, that is not straightforward. And we would lose the line style options and don't know if something more. But the selection problem is more serious and I'd like to solve it without changing the plot implementation, which I don't dare to change. But the only solution that I come to is forcing the order in the table by x when a point is selected, and then selecting the correct row. |
The tables/queries sorted by X are drawn using QCPGraph as before. Since QCPGraph does automatically sort by X, we change to QCPCurve that requires a third data vector to reflect the order. We get that from the current row order. In the case of curves, only None and Line is supported as line style. Since the order is now important for the plot, it is automatically updated whenever the user sorts by another column in the browsed table. This addresses issue #821 and indirectly fixes the problem of incorrect point->row selection link when the table is not sorted by X, reported in issue #838.
Details for the issue
Axis? Axes?
Well, my point is, it would be awesome to be able to change the limits of the axis window.
Right now it uses the current max/min for X and Ys, which is a little bit inconvenient. (Remember I can´t plot lines? So dots get cut in half)
Also, by adding that we would have a "zooming" tool. (I think this feature seems very easy to implement, whereas a true zooming thing seems much more complicated)
e.g. When I plot this:
I would rather be able to chose to have something like this:
Or in this occasion:
Where do all the corners (upper left side) that follow a straight line go down to? If I was able to chose "show me X from 0 to 200", I wouldn't be forced to go to EXCEL
Useful extra information
I'm opening this issue because:
I'm using DB4S on:
I'm using DB4S version:
I have also:
The text was updated successfully, but these errors were encountered: