PlotMorph
Last updated at 9:09 pm UTC on 29 June 2017
Maintained in
MCHttpRepository
location: 'http://www.squeaksource.com/PlotMorph'
user: ''
password: ''
Author: Diego Gomez Deck
Morph to draw XY plots. See the methods testXXX in the class side.
Try with:
PlotMorph test.
PlotMorph test2.
PlotMorph test4.
PlotMorph testWithReferences.
Look at the code behind those methods in Browser
Installation
- It is reachable with Package Loader as "Plot Morph" package (this is the best way how to install it).
- or you can download and install it on your own (if there is no Plot Morph package for your Squeak image version):
Note
- Unless you change your color depth from 16 to 32, you might experience some troubles concerning the improper color rendering. This is nothing harmfull but may confuse you so you better change it to 32. (world menu / appearance ... / set display depth ... / 32)
See it in action
In development
- Logarithmic and Exponential representation (eam)
Screenshots

Question
Kwiyi Woo February 01, 2004: I am pretty new to squeak and tried to use plotMorph to create a curve graph. I cannot find the methods "test", "test2" or "testWithReferences" in the PlotMorph class. How can the PlotMorph send message to them. Also I don't know how to plot a curve at specified function. Could anyone give me some suggestions?
Answer
German S. Arduino:
Look at class side for these methods. What I have found (in the test4) is this:
Raymond Asselin: As you see in a SystemBrowser, 5 classes are used to make aPlotMorph:
- AxesMorph,
- PlotMorph,
- PlotMorphGrid,
- PlotPoint and
- PlotSeries.
So if you want to get rid of PlotMorphGrid you have to find where this class is used.
function := [:x | x degreesToRadians sin / 5 +
((x / 10) degreesToRadians cos +
(x / 10) degreesToRadians sin) * 100].
0 to: 3000
by: 5
do: [:x | pm series: #test2 addPoint: x
& (function value: x)].
pm openInWorld 3
where a mathematical function is defined within a bloc [ :x | x blabla....]
and assigned to the variable function to be used in the loop below where the y value of a point is compute with that function . So, if you change the mathematical function in that bloc you'll have the result you are looking for.
Kwiyi Woo: I got the idea and successfully created my own graph. Thanks. But now I am trying to remove te grid on the Axis coordinators. In other words, I only want to keep the X and Y axis without having a grid on the background. Is there any attribute I can turn off?
One way to find this is: (1) to select the PlotMorphGrid class in the SystemBrowser and (2) to choose in the contextual menu (alt+click on a Mac // right button on Windows) the menu item Òclass refsÓ this will open a window with the Îusers1 of the selected class. You'll see that there is only one user, it is the class AxesMorph in is Îinitialize1 method. (3) Select it and you will see in the bottom pane the code. Find in which statement PlotMorphGrid is used. grid := PlotMorphGrid on: self.
I tried grid := self
and the result seem to be what you are looking for.
So remember to look for the class refs of a class when you want to know who uses it, or how it is used.
Related