Hello again,
My aim is to make a graph of pixels, but the main problem is that the values are not "glued" to each other, because the axis X and axis Y unit is not 1 unit = 1 dot
To be more clear, here is my current graph (the dots are at a resolution of 10x10 pixels) :
Here, the pixels are not glued :
http://imgur.com/a/1tLhz
Here, the pixels are glued (I made an unzoom)
http://imgur.com/a/42dPu
I want the graph to be exactly as an image would be : pixels next to each others.
Thanks in advance !
[Axis X and Axis Y] setting 1 unit = 1 dot
-
- Posts: 21
- Joined: Mon Jan 09, 2017 2:04 pm
- antibot: No, of course not.
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: [Axis X and Axis Y] setting 1 unit = 1 dot
THe major problem ist that with a fixed symbol size, the data points will only be "glued together" if you use a specific zoom level.
I do not think that there is an easy solution to achieve what you want. I had almost suggested to look at this thread and see whether you would like to write a renderer and dataset to create a heat map, but then I noted that your data popints do not form a regular grid.
I do not think that there is an easy solution to achieve what you want. I had almost suggested to look at this thread and see whether you would like to write a renderer and dataset to create a heat map, but then I noted that your data popints do not form a regular grid.
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: [Axis X and Axis Y] setting 1 unit = 1 dot
Alternatively, you could use an XYBlockRenderer and set the blockWidth to 1.0. Note that an XYBlockRenderer will also scale the symbol height to a user defined value.
-
- Posts: 21
- Joined: Mon Jan 09, 2017 2:04 pm
- antibot: No, of course not.
Re: [Axis X and Axis Y] setting 1 unit = 1 dot
The problem is that I need a LookupPaintScale and I can't use it with a DotRenderer :/
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: [Axis X and Axis Y] setting 1 unit = 1 dot
I was suggesting XYBlockRenderer, not XYDotRenderer.
-
- Posts: 21
- Joined: Mon Jan 09, 2017 2:04 pm
- antibot: No, of course not.
Re: [Axis X and Axis Y] setting 1 unit = 1 dot
Sorry for that, I confused Dot and Block.paradoxoff wrote:I was suggesting XYBlockRenderer, not XYDotRenderer.
However, the unit of Axis Y is half the unit of Axis X (http://imgur.com/a/9OS9O).
So,how to set the unit of Axis Y the same as X (to have a square, as I asked)?
-
- Posts: 1634
- Joined: Sat Feb 17, 2007 1:51 pm
Re: [Axis X and Axis Y] setting 1 unit = 1 dot
Ok, I think I have understood you requriement.
In general, I see two approaches:
- Make sure that the "aspect ratio" (length in data space divided by length in Java2D space) is the same for both axes. If the x axis has a value range from 0-100, and the data area has a width of 400 pixel anda height of 300 pixel, the y axis would need to have a value range of 75. Synchronizing the value range might be possible with an AxisChangeListener, but I do not see an easy way to keep the apsect ratio of the data area in sync.
- Write your own renderer that first determines the width of a data symbol in Java2D dependent on the current zoom level and then use the same Java2D length to draw a Rectangle at the given data coordinate.
In general, I see two approaches:
- Make sure that the "aspect ratio" (length in data space divided by length in Java2D space) is the same for both axes. If the x axis has a value range from 0-100, and the data area has a width of 400 pixel anda height of 300 pixel, the y axis would need to have a value range of 75. Synchronizing the value range might be possible with an AxisChangeListener, but I do not see an easy way to keep the apsect ratio of the data area in sync.
- Write your own renderer that first determines the width of a data symbol in Java2D dependent on the current zoom level and then use the same Java2D length to draw a Rectangle at the given data coordinate.