From: Dave C. <dav...@ce...> - 2005-04-29 04:34:44
|
Hi Micha and friends, I have implemented a similar scaling function as described in the emails below (Scaling of surface plots). The scaling works great, however I am left with a problem regarding the axes' scales. If I make a dataset that is of size (x = 4, y = 1000, z = 1000), then using the setScale method and algorithm documented below I can (correctly) show a "cube" of data (even though the dataset is actually a rectangle). However the scales on the y and z axes are blown completely out of proportion (i.e. the lines out from the data to the string labels are exceptionally long). Can anyone point me in a direction to correctly scale the axes lines? If anyone wants a screen shot then let me know and I'll forward it (I don't have access to the internet to upload it to a web page here at work). I apologise if this has already been answered on a forum, I can't get the internet here. Thanks for your help, Dave Cooper (Canberra, Australia) -----Original Message----- From: qwt...@li... [mailto:qwt...@li...] On Behalf Of qwt...@li... Sent: Tuesday, 26 April 2005 1:31 PM To: qwt...@li... Subject: qwtplot3d-interest digest, Vol 1 #33 - 3 msgs Send qwtplot3d-interest mailing list submissions to qwt...@li... To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/qwtplot3d-interest or, via email, send a message with subject or body 'help' to qwt...@li... You can reach the person managing the list at qwt...@li... When replying, please edit your Subject line so it is more specific than "Re: Contents of qwtplot3d-interest digest..." Today's Topics: 1. Scaling of surface plots (Stefan Gerlach) 2. Re: Scaling of surface plots (Micha Bieber) 3. Re: Scaling of surface plots (Keith, Todd) --__--__-- Message: 1 From: Stefan Gerlach <ge...@mb...> Organization: MBI To: qwt...@li... Subject: Scaling of surface plots Date: Mon, 25 Apr 2005 09:59:05 +0200 --Boundary-02=_VNKbCYSmBbjNgLj Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi,=20 =20 I have some difficulties to scale surface plots to the correct size.=20 I'm using "loadFromData(data,cols,rows,0,cols,0,rows)"=20 to make a surface plot with different cols/rows combinations. Depending on rows/cols and zrange of the data the plot is very tiny or too= =20 big. I tried some combinations of setScale(1/rows,1/cols,1/zrange), etc.= =20 but had no luck to find the right combination.=20 =20 Is there a way to scale the surface plot to the correct size (depending on= =20 rows,cols,zrange)? How can i scale the plot to have all axes with the same= =20 size (aspect ratio) and always fit on the screen? =20 Thanks in advance. Stefan Gerlach --Boundary-02=_VNKbCYSmBbjNgLj Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBCbKNVa9g3y2xF0AARAldBAJ9m8J24aEeHZPt4dy0+F/m9lviltQCfUqDB 3KFINp0tJD2jrN4BTjnS/Pg= =IdWw -----END PGP SIGNATURE----- --Boundary-02=_VNKbCYSmBbjNgLj-- --__--__-- Message: 2 Date: Mon, 25 Apr 2005 14:30:59 +0200 From: Micha Bieber <kri...@us...> To: qwt...@li... Subject: Re: Scaling of surface plots Stefan, please check the forum for an answer. Micha -- --__--__-- Message: 3 Subject: Re: Scaling of surface plots Date: Mon, 25 Apr 2005 09:22:54 -0500 From: "Keith, Todd" <ke...@um...> To: <qwt...@li...> Reply-To: qwt...@li... Consider something like this ... ***** Let minX and maxX be the minimum and maximum value, respectively, of = your data along the x-Axis Let minY and maxY be the minimum and maximum value, respectively, of = your data along the y-Axis Let minZ and maxZ be the minimum and maximum value, respectively, of = your data along the z-Axis ***** double rangeX =3D fabs(maxX - minX); double rangeY =3D fabs(maxY - minY); double rangeZ =3D fabs(maxZ - minZ); double maxRange =3D rangeX; if (rangeY > maxRange) maxRange =3D rangeY; if (rangeZ > maxRange) maxRange =3D rangeZ; double scaleX =3D maxRange / rangeX; double scaleY =3D maxRange / rangeY; double scaleZ =3D maxRange / rangeZ; double maxScale =3D scaleX; if (scaleY > maxScale) maxScale =3D scaleY; if (scaleZ > maxScale) maxScale =3D scaleZ; setScale(scaleX, scaleY, scaleZ); --__--__-- _______________________________________________ qwtplot3d-interest mailing list qwt...@li... https://lists.sourceforge.net/lists/listinfo/qwtplot3d-interest End of qwtplot3d-interest Digest |