Title: Different logarithmic scale behavior when compared to Qwt · Issue #94 · PlotPyStack/PythonQwt · GitHub
Open Graph Title: Different logarithmic scale behavior when compared to Qwt · Issue #94 · PlotPyStack/PythonQwt
X Title: Different logarithmic scale behavior when compared to Qwt · Issue #94 · PlotPyStack/PythonQwt
Description: Hi folks, We are having different results when using the logarithmic scale compared with Qwt. Qwt from PyQt5.QtWidgets import QApplication from Qwt5 import QwtPlot, QwtPlotCurve, QwtLog10ScaleEngine app = QApplication([]) plot = QwtPlot(...
Open Graph Description: Hi folks, We are having different results when using the logarithmic scale compared with Qwt. Qwt from PyQt5.QtWidgets import QApplication from Qwt5 import QwtPlot, QwtPlotCurve, QwtLog10ScaleEngin...
X Description: Hi folks, We are having different results when using the logarithmic scale compared with Qwt. Qwt from PyQt5.QtWidgets import QApplication from Qwt5 import QwtPlot, QwtPlotCurve, QwtLog10ScaleEngin...
Opengraph URL: https://github.com/PlotPyStack/PythonQwt/issues/94
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Different logarithmic scale behavior when compared to Qwt","articleBody":"Hi folks,\r\n\r\nWe are having different results when using the logarithmic scale compared with `Qwt`.\r\n\r\n# Qwt\r\n\r\n```python\r\nfrom PyQt5.QtWidgets import QApplication\r\nfrom Qwt5 import QwtPlot, QwtPlotCurve, QwtLog10ScaleEngine\r\n\r\n\r\napp = QApplication([])\r\nplot = QwtPlot()\r\nplot.setWindowTitle(\"Qwt\")\r\nplot.resize(800, 600)\r\n\r\ny = [1, 500, 1000, 1500]\r\nx = [1, 2, 3, 4]\r\n\r\ncurve = QwtPlotCurve()\r\ncurve.setData(x, y)\r\n\r\nengine = QwtLog10ScaleEngine()\r\nplot.setAxisScaleEngine(QwtPlot.yLeft, engine)\r\n\r\ncurve.attach(plot)\r\nplot.show()\r\napp.exec()\r\n```\r\n\r\n\r\n\r\n\r\n\r\n# PythonQwt\r\n\r\n```python\r\nfrom PyQt5.QtWidgets import QApplication\r\nfrom qwt import QwtPlot, QwtPlotCurve, QwtLogScaleEngine\r\n\r\n\r\napp = QApplication([])\r\nplot = QwtPlot()\r\nplot.setWindowTitle(\"PythonQwt\")\r\nplot.resize(800, 600)\r\n\r\ny = [1, 500, 1000, 1500]\r\nx = [1, 2, 3, 4]\r\n\r\ncurve = QwtPlotCurve()\r\ncurve.setData(x, y)\r\n\r\nengine = QwtLogScaleEngine()\r\nplot.setAxisScaleEngine(QwtPlot.yLeft, engine)\r\n\r\ncurve.attach(plot)\r\nplot.show()\r\napp.exec()\r\n```\r\n\r\n\r\n\r\n\r\n---\r\n\r\nThe original `Qwt` scale looks right, but `PythonQwt` is not really logarithmic... any ideas what the problem might be? I suspect it might be related to the fact that now `PythonQwt` uses a better overall auto range calculation to give some room on each side of each axis (which looks much better in normal situations), but this extra room might not be playing well with the old logarithmic scaling code, but this is just a hunch.\r\n\r\nI did look at the [`QwtLogScaleEngine.autoScale` method](https://github.com/PlotPyStack/PythonQwt/blob/582289a8f29972690e1567a2d423e4894f42bcaf/qwt/scale_engine.py#L643-L714) in comparison [with the original](https://sourceforge.net/p/qwt/code/HEAD/tree/trunk/qwt/src/qwt_scale_engine.cpp#l798), and everything seems well.\r\n\r\nAny hints/suggestions would be greatly appreciated! 👍 \r\n","author":{"url":"https://github.com/nicoddemus","@type":"Person","name":"nicoddemus"},"datePublished":"2024-12-27T12:50:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/94/PythonQwt/issues/94"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:35595561-be9f-ae24-17dc-e52802525143 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3A2:B4897:27B6C9C:355D36A:6972E195 |
| html-safe-nonce | a9c1415a3d17d5fde169bc1f1e245c837c98ebe24971f01d82034c119c3281e5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0EyOkI0ODk3OjI3QjZDOUM6MzU1RDM2QTo2OTcyRTE5NSIsInZpc2l0b3JfaWQiOiI3MjA0OTAzODM5NDg2NjMyMzQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 82bd5202670dccdeba433484e84d43c43c5ca6d7054e6bb2323e32dd49acc448 |
| hovercard-subject-tag | issue:2760848892 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PlotPyStack/PythonQwt/94/issue_layout |
| twitter:image | https://opengraph.githubassets.com/204e9b56393cedc5072196efdd9ef47f057ac8f8f5a5d3d64617c31e0f86eaa2/PlotPyStack/PythonQwt/issues/94 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/204e9b56393cedc5072196efdd9ef47f057ac8f8f5a5d3d64617c31e0f86eaa2/PlotPyStack/PythonQwt/issues/94 |
| og:image:alt | Hi folks, We are having different results when using the logarithmic scale compared with Qwt. Qwt from PyQt5.QtWidgets import QApplication from Qwt5 import QwtPlot, QwtPlotCurve, QwtLog10ScaleEngin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nicoddemus |
| hostname | github.com |
| expected-hostname | github.com |
| None | 824b30a290fe1f3775d1c3b755ace6ec71165752363f95d9255c1b87220040e4 |
| turbo-cache-control | no-preview |
| go-import | github.com/PlotPyStack/PythonQwt git https://github.com/PlotPyStack/PythonQwt.git |
| octolytics-dimension-user_id | 145201262 |
| octolytics-dimension-user_login | PlotPyStack |
| octolytics-dimension-repository_id | 41204495 |
| octolytics-dimension-repository_nwo | PlotPyStack/PythonQwt |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 41204495 |
| octolytics-dimension-repository_network_root_nwo | PlotPyStack/PythonQwt |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ef892904a22cef6ce15e4347cbf70e4cbfdc883 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width