Here is a possible patch to fix this issue. Any segment is dropped if both end points are on the same side either of the top, the bottom, the left or the right.
Updated debian/control to support also Debian 12 Bookworm.
Adding cpack generation in cmake
Fix an issue in representation of UTF-8 labels for mpBarChart - missing c_str call.
Fix an issue in representation of UTF-8 labels for mpBarChart.
Introduced mpBarChart class to draw bar charts, and a matching new sample.
One solution is to remove the piece of code in charge of plotting only visible segments: lines 650 to 688 of mathplot.cpp@rev102 and just keep dc.DrawLine(x0, c0, x1, c1); and UpdateViewBoundary. The drawback of this solution is that it will plot all segments even if they are not visible. I wonder if detecting the intersection between each segment and one of the window borders is very interesting because it requires a lot of computations as well. Which solution is the best?
mpFXYVector bug when vector is outside the bounding box
Small improvement to zoom in (zoom out as well).
Crashes on Windows due to division by zero and log of negative number.
Done, mpFX and mpFXYVector fixed.
Fixed it for mpFY, later I'll fix the others.
Hi, thanks for the response. By reading the source code, I think to find the closest point, the current implementation of FX, FY, FXYvectors is wrong, I think the FXY is correct(You have to override the function GetNextXY: class MyLissajoux : public mpFXY { double m_rad; int m_idx; public: MyLissajoux(double rad) : mpFXY( wxT("Lissajoux")) { m_rad=rad; m_idx=0; m_drawOutsideMargins = false;} virtual bool GetNextXY( double & x, double & y ) { if (m_idx < 360) { x = m_rad * cos(m_idx / 6.283185*360);...
Hi Ollydbg, I enabled the issue option on the repo. I'll look into it when I have the time. Is the the problem only with FY? Is it working ok with FXYvectors?
Hi, Naiche Barcelos, here is another issue of your code, I wrote it in the issue of my fork See here with a screen shot: Find the nearest point on the FY, the current method is not correct · Issue #2 · asmwarrior/wxMathPlot-TrackBox BTW: the previous issue is also wrote as: How to find the nearest point in FXYVector? · Issue #1 · asmwarrior/wxMathPlot-TrackBox
Hi, Naiche Barcelos, here are another issue of your code, I wrote it in the issue of my fork See here with a screen shot: Find the nearest point on the FY, the current method is not correct · Issue #2 · asmwarrior/wxMathPlot-TrackBox BTW: the previous issue is also wrote as: How to find the nearest point in FXYVector? · Issue #1 · asmwarrior/wxMathPlot-TrackBox
Hi, Naiche Barcelos. Since you github repo don't have issue option enabled, I have to wrote it here. In the function std::pair<mpLayer*, wxRealPoint> mpWindow::GetClosestPoint(double x, double y) There are some code snippet: if ((*li)->IsVector()) { mpFXYVector *vect = (mpFXYVector*)(*li); int distX, closestI=0; distX = x - vect->m_xs[0]; //runs through vector looking for the closest X value for (int i = 1; i < vect->m_ys.size(); i++) { if (abs(x - vect->m_xs[i]) < distX) { distX = x - vect->m_xs[i];...
BTW: I have asked the original question in wx forum, see here: wxTipWindow vs wxToolTip used inside wxMathPlot class Someone replied to that question, and he suggest that I should use the native tip window. (The good_tip screen shot)
Hi, Naiche Barcelos, thanks for the reply. I will try your github code repo, and I see you made a good contribution to wxMathPlot. The TrackBox is a feature I'm expecting for many years. I'm grad that you already implemented it.
Hi ollydbg, if you're interested, I've done lot of changes to the way wxMathPlot shows that window, I've called it TrackBox and I made it so you can bind its appearance to any mouse button. The code is available at github.com/naiche/wxMathPlot.
Here is the good tip.
I uploaded the "bad_tip" window(the code in first place) and "good_tip" (the code in second place) window screen shots as attachments. The good tip screen shot will be uploaded in another post.
I see currently there are two tooltip related code which are comment out, I just try to enable it, but it does not work quite well. The first place: In this function: void mpWindow::OnMouseMove(wxMouseEvent &event) if (m_coordTooltip) { wxString toolTipContent; toolTipContent.Printf(_("X = %f\nY = %f"), p2x(event.GetX()), p2y(event.GetY())); wxTipWindow** ptr = NULL; wxRect rectBounds(event.GetX(), event.GetY(), 5, 5); wxTipWindow* tip = new wxTipWindow(this, toolTipContent, 100, ptr, &rectBounds);...
Library installation path on Linux resulted to be empty in CMake file. CD-RON77
Removed comment line which seems to disturb some builds. CD-RON77
Remove forced installation of library in lib64 under Linux. CD-RON77
Adding debian/source/format file to support building on latest Ubuntu 22.04. CD-RON77
Any idea on how to implement this feature? I also need such feature, while I see there is no simple way to handle this. See my reply here: Reverse Y-Axis in wxMathplot — https://forums.wxwidgets.org/viewtopic.php?f=1&t=45412
Minor issues in CMakeLists.txt
Hello, I would like to have an x-axis and y-axis where their 0's start at the center of the frame. Also, the increment and decrement of both rulers should be by 30. I have a sample drawing of this as an attachment. How do I translate this in code? Thank you! EDIT: I managed to get this working by providing the limits to the Fit() function, like so: Fit(-180.0, 180.0, -90.0, 90.0);, now I am still unsure about the gap/increment/decrement -- it seems like it is calculated based on the window size.
Update: Resizing the image seemed to helped clear out the error: ./src/gtk/bitmap.cpp(988): assert "rect.x >= 0 && rect.y >= 0 && rect.x + w <= bmpData->m_width && rect.y + h <= bmpData->m_height" failed in GetSubB itmap(): invalid bitmap region However, the ./src/gtk/bitmap.cpp(924): assert "IsOk()" failed in GetWidth(): invalid bitmap Is still there on startup.
I want to load an image using mpBitmapLayer. mpBitmapLayer *bitmapLayer = new mpBitmapLayer(); wxImage *image = new wxImage("/some/path/image.jpg", wxBITMAP_TYPE_JPEG); bitmapLayer->SetBitmap(*image, 0, 0, 100, 100); bitmapLayer->SetAlign(mpALIGN_CENTER); However, I get the following errors: ./src/gtk/bitmap.cpp(924): assert "IsOk()" failed in GetWidth(): invalid bitmap ./src/gtk/bitmap.cpp(988): assert "rect.x >= 0 && rect.y >= 0 && rect.x + w <= bmpData->m_width && rect.y + h <= bmpData->m_height"...
Hello, I would like to have an x-axis and y-axis where their 0's start at the center of the frame. Also, the increment and decrement of both rulers should be by 30. I have a sample drawing of this as an attachment. How do I translate this in code? Thank you!
Thank you, that worked. :)
Hello, you are right, repository trunk contains a lot of fixes and updates for latest wxWidgets (I've built up to 3.1.4 currently), and the distributed release was outdated. I released 0.2.0 last week to get in sync, and I hope to make some code and build cleanup in the near future.
Hi, you should use an mpBitmapLayer for that. Just put it at the bottom of the layer stack (so add it as first layer).
The title pretty much sums up my question. If I want to plot latitude/longitude, I would like to have the Earth's 2D map under the plot as a background image. Is this possible?
Cleanup of CMake warnings.
Updated version files and changelogs for release of 0.2.0.
New release
Fix install command for Windows cross-building using MinGW. CD-RON77
Thanks I can compile now.
Hi, I used wxmathplot a long time ago. It is great the someone still cares about it. But for testing it now I just added mathplot,cpp and mathplot.h to my project. I had to change some wxDOT to wxPENSTYLE_DOT. Same for brushes. But after that it compiled and ran as expected with the mp1.cpp. I used the trunk/mathplot, following cdron77's recommadation to Sergey Goncharov on 2020-03-02in the discussion list. Den tors 14 maj 2020 kl 01:22 skrev Albert sedin@users.sourceforge.net: Thanks for your comment....
Thanks for your comment. Is build sequence correct?
I normally use wxMathPlot with wxWidgets 3.1 and MinGW. It is not an issue, but please use the the latest SVN version, because prebuilt packages are outdated. If you experience other issues, feel fre to write them here.
maybe wxMathplot is not compatible for wxWidgets 3.x.x. give up.
maybe wxMathplot is not compat ible for wxWidgets 3.x.x. give up.
I would like to use wxMathplot. But I have few comile erros when I built this. I want to know how to solve this. sorry to bother you. [Environment] MinGW (Compiler) wxWidgets 3.1.3 (GUI Lib) Code::Blocks (IDE) [What I Did] 1. Download wxMathplot 2. Go to wxMathplot folder 3. cmake-gui 4. Click generate 5. Check and set path to option 6. Click generate 7. make //mingw [problem] I got some erros
I would like to use wxMathplot. But I can not how to start. I want to know how to solve this. sorry to bother you. [Environment] MinGW (Compiler) wxWidgets 3.1.3 (GUI Lib) Code::Blocks (IDE) [What I Did] 1. Download wxMathplot 2. Go to wxMathplot folder 3. cmake-gui 4. Click generate 5. Check and set path to option 6. Click generate 7. make //mingw [problem] I got some erros
Hi, Thanks for your reply. I just read this. I added a second mpScaleY, but the scale appears identical to the primary y-axis. I The code I have written is: Header file: #ifndef MATHPLOTWND_H #define MATHPLOTWND_H #include "../mathplot.h" #include "BuildArrays.h" class mpWindow; class Example_8_WorkFrame; class MathPlotWnd { public: MathPlotWnd(BuildArrays& plotData, mpWindow* mpWnd); virtual ~MathPlotWnd(); void createMathPlot(); void updateMathPlot(); protected: private: mpScaleX* xaxis = new mpScaleX(wxT("Time(s)"),...
Hi, Thanks for your reply. I just read this. I added a second mpScaleY, but the scale appears identical to the primary y-axis: The code I have written is: Header file: #ifndef MATHPLOTWND_H #define MATHPLOTWND_H #include "../mathplot.h" #include "BuildArrays.h" //class IncomingData; class mpWindow; class Example_8_WorkFrame; class MathPlotWnd { public: MathPlotWnd(BuildArrays& plotData, mpWindow* mpWnd); virtual ~MathPlotWnd(); void createMathPlot(); void updateMathPlot(); protected: private: mpScaleX*...
Hi, Thanks for your reply. I just read this. I added a second mpScaleY, but the scale appears identical to the primary y-axis: The code I have written is: Header file: #ifndef MATHPLOTWND_H #define MATHPLOTWND_H #include "../mathplot.h" #include "BuildArrays.h" //class IncomingData; class mpWindow; class Example_8_WorkFrame; class MathPlotWnd { public: MathPlotWnd(BuildArrays& plotData, mpWindow* mpWnd); virtual ~MathPlotWnd(); void createMathPlot(); void updateMathPlot(); protected: private: mpScaleX*...
Hi, Thanks for your reply. I just read this. I added a second mpScaleY, but the scale appears identical to the primary y-axis: The code I have written is: Header file: #ifndef MATHPLOTWND_H #define MATHPLOTWND_H #include "../mathplot.h" #include "BuildArrays.h" //class IncomingData; class mpWindow; class Example_8_WorkFrame; class MathPlotWnd { public: MathPlotWnd(BuildArrays& plotData, mpWindow* mpWnd); virtual ~MathPlotWnd(); void createMathPlot(); void updateMathPlot(); protected: private: mpScaleX*...
Hi, Thanks for your reply. I just read this. I added a second mpScaleY, but can't plot anything to it. The code I have written is: Header file: #ifndef MATHPLOTWND_H #define MATHPLOTWND_H #include "../mathplot.h" #include "BuildArrays.h" //class IncomingData; class mpWindow; class Example_8_WorkFrame; class MathPlotWnd { public: MathPlotWnd(BuildArrays& plotData, mpWindow* mpWnd); virtual ~MathPlotWnd(); void createMathPlot(); void updateMathPlot(); protected: private: mpScaleX* xaxis = new mpScaleX(wxT("Time(s)"),...
Hi, I think that it should be a matter of adding a second mpScaleY layer with a different scale factor and a different position flag (mpALIGN_RIGHT and mpALIGN_LEFT for example). But probably you need to derive a new class to set a different scaling factor. I hope this helps. CD-RON77
Hi, I've been using Mathplot for a while. I've hit a snag though.. I'd like to plot a couple of vectors to a secondary axis. I've looked through the documentation, but can't seem to find a way to do this. If anyone has any ideas, would be great. Thanks, Paul
I feel a little uneasy that I have to bother you again, but the graphic still asks questions in the answers to which I am not sure . It asks wxWidgets_LIB_DIR? I say - G:/wxWidgets/lib , It asks wxWidgets_ROOT_DIR? I say - G:/wxWidgets , It asks wxWidgets_wxrc_EXECUTABLE? - in this place, I find it difficult to tell, maybe there is an instruction as for example on the site https://github.com/cjcliffe/CubicSDR/wiki/Build-Windows. In the end, I click "Generate" and of course I get an error - " wxWidgets,...
The library builds also on Windows without Cygwin. README file refers to the build procedure that should work on POSIX systems. Under Windows I suggest to use graphical version of CMake and select proper compiler from there. I did not test recent Visual Studio, but it worked until 2012 version.
Thank you, I downloaded it from your link , but the manual READMR says that you need a POSIX system, but I have Windows, I need to try installing it through Cygwin or some other way. Sincerely Sergey.
Please download the trunk/mathplot folder, sandbox branch is very outdated (2007).
Hello, thanks for the answer. Could you give me a solution to my problem I Installed wxWidgets-3.1.3, built it in the win32 configuration, downloaded to the neighboring directory "wxmathplot-svn-r95-branches-sandbox-mathplot.zip", unpacked,, went to the directory where the Makefile file is located, executed the command - "make" in the command line and received the following error - >make g++ -c -wall 'wx-config --cxxflags' matplot.cpp -o matplot.o g++: error: 'wx-config: No such file or directory...
Hello, there was a page with instructions somewhere, but I can't find it now. Anyway, probably it is outdated, so I summarize it here. wxMathPlot uses CMake as build tool, to generate project files for different compilers according to user needs. You also need wxWidgets configured in your compiler in order to build (see this page for install instructions). Currently I use MinGW as cross compiler for Windows, so I did't test latest versions of Visual Studio, but basically, copy wxMathPlot SVN version...
Hi friends, tell me how to install wxMahtPlot under Windows or give a link to the instructions. Thank you in advance for your help.
Hello Tilen, I believe the best solution for you is to get a pointer to the popup menu item using the method mpWindow::GetPopupMenu() http://wxmathplot.sourceforge.net/docs/a00018.html#a552cc32aa4f45c31cfa60ec0dba73ec8 Using that reference you get a standard wxMenu ( https://docs.wxwidgets.org/3.0/classwx_menu.html ) object, which you can manipulate adding and removing items and their callbacks. THis way you can remove standard "Fit" action and add your own. CD_RON77
Hello Tilen, I believe the best solution for you is to get a pointer to the popup menu item using the method mpWindow::GetPopupMenu() http://wxmathplot.sourceforge.net/docs/a00018.html#a552cc32aa4f45c31cfa60ec0dba73ec8 Using that reference you get a standard wxMenu (https://docs.wxwidgets.org/3.0/classwx_menu.html) object, which you can manipulate adding and removing items and their callbacks. THis way you can remove standard "Fit" action and add your own. CD_RON77
Hello everyone! In my wxPanel, I have inserted two graphs (along with other things). For the upper one I did not specify any axes limits (I just used mygraph1->Fit();), but for the lower one, I specified axes limits with mygraph2->Fit(100,700,0.7,12);. This works fine, however, I have one problem: Whenever I right click on the lower graph and click Fit, it changes axes limits to standard limits ( not the 100,700,0.7,12 that I specified). I realise that this is the consequence of the OnFit function...
Force lib64 as needed. CD-RON77
Updating Base.spec. CD-RON77
Still updating RPM build. CD-RON77
Change Spec file. CD-RON77
Updated RPM and DEB builds. CD-RON77
Updated debian/control file to add compatibility with Ubuntu 18.04. CD_RON77
Fixed bug when saving screenshots when not in white background: taxt elements were always printed in black. CD-RON77
Hello all, Does anyone know how to reverse y-axis in wxMathplot? Currently, my Y-Axis starts from 0 at the bottom and goes up to the max value (for example 100) on the top. Is there a function or method to make the Y-Axis to start at the max value (100) from the bottom and go up to 0 on the top? I attached a picture for reference. Thank you! GeY
Hello all, Does anyone know how to reverse y-axis in wxMathplot? Currently, my Y-Axis starts from 0 at the bottom and goes up to the max value (for example 100) on the top. Is there a function or method to make the Y-Axis to start at the max value (100) from the bottom and go up to 0 on the top? I attached a picture for reference. Thank you! py
Adding the option to printout date and time data using gmtime instead of localtime. CD-RON77
Implemented formatting mouse coordinate display in the same way as x axis using time formats. Removed some gcc build warnings. CD-RON77
Introduced item mode in mpInfoLegend, to draw a square instead of a line in legend, which is more clear. CD-RON77
Final fix for mpInfoCoords rectangle size on Windows. CD-RON77
Try to fix visualization of mpInfoCoords on Windows with recent versions of wxWidgets: force increasing y size of rectangle. CD-RON77
Try to fix visualization of mpInfoCoords on Windows with recent versions of wxWidgets. CD-RON77
mpScaleX labels: under WIN32 platform time_t is 32 bit signed, so dates has to be checked to be valid to avoid crashes. This is subject to 2038 bug, but should be avoided on 64 bit builds. CD-RON77
Fix X scale: if X axis is set to date/time format, avoid negative values, which are not recognized by Windows. Initialized coords in mpScaleY to avoid flooding valgrind outputs of warnings. CD-RON77
Sample 1 runtime error: ../src/gtk/window.cpp(4754): assert "sb" failed in SetScrollbar(): this window is not scrollable -L/usr/lib/x86_64-linux-gnu -pthread -lwx_gtk2u_xrc-3.0 -lwx_gtk2u_webview-3.0 -lwx_gtk2u_html-3.0 -lwx_gtk2u_qa-3.0 -lwx_gtk2u_adv-3.0 -lwx_gtk2u_core-3.0 -lwx_baseu_xml-3.0 -lwx_baseu_net-3.0 -lwx_baseu-3.0
Sample 1 runtime error: ../src/gtk/window.cpp(4754): assert "sb" failed in SetScrollbar(): this window is not scrollable
Merged modifications with repository. Davide
Update for building on Debian 9 Stretch.
Fixed checking of wxWidgets version on example ...
I too cannot build this at all, mostly due to the wxLog-related errors, using wx3.02...
Compilation error on ::wxErrorLog calls
In mathplot.cpp, change all references from "::wxLogError" to "wxLogError". This...
Dear Experts, I'm trying to compile the examples against wxWidgets 3.0, and I am...
Dear Experts, I'm trying to compile the examples against wxWidegets 3.0, and I am...
[PATCH] Initialize member variables in constructor
[PATCH] Fix wrong text position setting
For those who are interested in logarithmic scales, maybe this function will get...
For those who are interested in logarithmic scales, maybe this function will get...
For those who are interested in logarithmic scales, maybe this function will get...