473,698 Members | 2,379 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

dislin interfaced with tkinter

Hi,

I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?

thx
Jul 18 '05 #1
5 2130
eesun wrote:
I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?


I believe that dislin plots trough its own graphical device
that is independent of Tkinter thus cannot be integrated
with it.

You might want to try matplotlib, it has Tk backend

http://matplotlib.sourceforge.net/

the nice folks there might be able to help you out.

Istvan.

Jul 18 '05 #2
On 3 Aug 2004, eesun wrote:
I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?


I don't know anything about dislin; scanning through its web site, it
looks like a commercial C program. The only two ways I can think of to
integrate something like this into a Tkinter (or any toolkit) application
are:

1) If there's a way to pass dislin a window ID in which to draw (it
doesn't look like it; its openwin() function uses internal IDs), you can
create a Frame widget and pass the value returned by its .winfo_id()
method to the library.

2) If you can find no better way, as a last resort you can have dislin
write its output to an image file, and read the file using the Python
Imaging Library (PIL), which is integrated very well into Tkinter (you can
use its ImageTk class to create an image suitable for a Label, Canvas, or
what-have-you).

If your application isn't dependant on dislin and doesn't need 3D
graphing capabilities, consider switching to matplotlib
(http://matplotlib.sf.net/), which provieds the embedability you want.

Jul 18 '05 #3

"eesun" <ee***@free.f r> wrote in message
news:34******** *************** ***@posting.goo gle.com...
Hi,

I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?

thx


I haven't worked with Dislin/Tkinter but I have worked with Dislin/wxPython
and what you can do is dump the Dislin output into a string buffer.

A shade plot,

def dis_img(self,zm at,m, n, zlo, zhi):
char = ''
max_bytes = 0
xray = range (n)
yray = range (m)
dislin.metafl ('VIRT')
dislin.setpag ('da4l')
#dislin.setfil (self.globdir)
dislin.disini ()
dislin.pagera ()
dislin.hwfont ()
dislin.ax3len (1400, 1400,1400)
dislin.autres(n , m)
dislin.shdmod ('poly', 'contur')
dislin.graf3 (0, n, 0, n/5, 0, m, 0, m/5, zlo, zhi, zlo, (zhi-zlo)/5)
dislin.crvmat (zmat, n, m, 1, 1)
dislin.title ()
char_buff = dislin.rbfpng(m ax_bytes)
max_bytes = int(char_buff[1])
char_buff = dislin.rbfpng(m ax_bytes)
char = char_buff[0]
#char now contains a PNG image of the output. I use Python Imaging
Library
#and open like this
self.Imagetest = Image.open(Stri ngIO.StringIO(c har))
dislin.disfin ()

Tom
Jul 18 '05 #4
On Tue, 3 Aug 2004, Tom B. wrote:
I haven't worked with Dislin/Tkinter but I have worked with Dislin/wxPython
and what you can do is dump the Dislin output into a string buffer.

[code]


Building on that, the only change needed to use that with Tkinter would be
to convert the Image object into a PhotoImage object using
ImageTk.PhotoIm age:

self.Imagetest = ImageTk.PhotoIm age(Image.open( StringIO.String IO(char)))

Jul 18 '05 #5
eesun wrote:
I've downloaded the dislin package for the scientific plotting. And I
have already created the application window with Tkinter (menu,
canvas, status bar..). I want to integrate the Dislin plotting into
the Tkinter application. For ex: show the dislin result on the Tkinter
Canvas. Anyone can help?


There is a package called disipyl which provides a more object oriented
interface to dislin. It includes interfaces to wxPython and Tkinter. It
hasn't been updated in a couple of years, but dislin hasn't changed much in
that time either.

http://kim.bio.upenn.edu/~pmagwene/disipyl.html
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1939
by: Gaubitzer Erwin | last post by:
Hi everybody I want to recompile the DISLIN graphics module for Python under Linux, because I think it is one of the best graphics libraries at present. The included module was for version 2.0 and I want it for 2.2 or maybe 2.3. The problem is, that I use the small make_py script which only calls the gcc compiler CC="gcc -fPIC -c -O" PYTH_INC="/usr/local/include/python2.0"
1
1608
by: Karin Lagesen | last post by:
I have a lot of data that I am going to plot and put on a web server. Since there is a lot of it, I was planning to script it all using python. I have looked around and it seems to me that dislin is good for doing the plots. However, I cannot seem to find the file/package/?? that I need to do the following statement: from dislin import * which the dislin python manual describes.
2
1989
by: Tom Richardson | last post by:
If anyone has any experience using the graphics package DISLIN with Python, I'd appreciate some help. I am trying to use the function tifmod to change the resolution of a tif graphics file. Either I am using it incorrectly, or I don't understand what it is supposed to do. If I use tifmod(N,'INCH','RESOLUTION')
6
2658
by: Richard | last post by:
I am going to need to plot some data and formula results from Python. A few years ago I used gnuplot (not from Python) and was wondering which Python plotting module I should use (learn)? I have seen DISLIN mentioned on "onlamp.com" and see that gnuplot has a python module wrapper. Any suggestions on Python plotting modules? (DISLIN or gnuplot.py or ????) Thanks
1
2200
by: pwhbeck | last post by:
Linux SUSE 10.1 Python 2.5 Dislin 9.1 Download dislin 9.1, change to directory dislin-9.1/python Change make_py to: elif test $1 = lnx ; then CC="gcc -fPIC -c -O" PYTH_INC="/usr/local/include/python2.5" PYTH_CONF="/usr/local/lib/python2.5/config"
3
2221
by: luis | last post by:
Hello! I have an unespectedn result with dislin titlin dislin.metafl ('WMF') dislin.disini () ..... a="Andrés or Ramón" dislin.titlin (a.encode("Latin-1"), 1)
1
1768
by: adolfo | last post by:
I am at the very beginning of the DISLIN 9.3 Manual: 1.4 Quickplots Some quickplots are added to the DISLIN module which are collections of DISLIN routines for displaying data with one command. For example, the function ’plot’ displays two-dimensional curves. Example: from Numeric import * from dislin import * x = arange (100, typecode=Float32) plot (x, sin (x/5)) disfin ()
3
2529
by: adolfo | last post by:
*** I thought I posted this subject 45 min ago but it does not show so something went wrong and it does not show up. Excuse me if I repeat myself *** DISLIN 9.3 old manual problems I just installed DISLIN 9.3 for python (DISPY is installed too) and I am up to: 1.4 Quickplots
0
1930
by: Helmut Michels | last post by:
Dear C/C++ programmers, I am pleased to announce version 9.4 of the data plotting software DISLIN. DISLIN is a high-level and easy to use plotting library for displaying data as curves, bar graphs, pie charts, 3D-colour plots, surfaces, contours and maps. Several output formats are supported such as X11, VGA, PostScript, PDF, CGM, WMF, HPGL, TIFF, GIF, PNG, BMP and SVG.
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8604
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.